diff options
author | webchick <webchick@24967.no-reply.drupal.org> | 2012-04-12 07:24:15 -0700 |
---|---|---|
committer | webchick <webchick@24967.no-reply.drupal.org> | 2012-04-12 07:24:15 -0700 |
commit | 91d8707e848284167467ccb699a2693c58cb0c10 (patch) | |
tree | 7ee52220c92d521971f5806e7232230385c797b4 | |
parent | e22feb71235729868069fbe862e804d66369d335 (diff) | |
download | brdo-91d8707e848284167467ccb699a2693c58cb0c10.tar.gz brdo-91d8707e848284167467ccb699a2693c58cb0c10.tar.bz2 |
Issue #1513520: And NOW with the actual fix, not just the failing test. Sigh. :P
-rw-r--r-- | includes/locale.inc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/includes/locale.inc b/includes/locale.inc index bc2d58dd7..7fb8d6424 100644 --- a/includes/locale.inc +++ b/includes/locale.inc @@ -141,7 +141,7 @@ function locale_language_from_browser($languages) { // language-range = ( ( 1*8ALPHA *( "-" 1*8ALPHA ) ) | "*" ) // Samples: "hu, en-us;q=0.66, en;q=0.33", "hu,en-us;q=0.5" $browser_langcodes = array(); - if (preg_match_all('@([a-zA-Z-]+|\*)(?:;q=([0-9.]+))?(?:$|\s*,\s*)@', trim($_SERVER['HTTP_ACCEPT_LANGUAGE']), $matches, PREG_SET_ORDER)) { + if (preg_match_all('@(?<=[, ]|^)([a-zA-Z-]+|\*)(?:;q=([0-9.]+))?(?:$|\s*,\s*)@', trim($_SERVER['HTTP_ACCEPT_LANGUAGE']), $matches, PREG_SET_ORDER)) { foreach ($matches as $match) { // We can safely use strtolower() here, tags are ASCII. // RFC2616 mandates that the decimal part is no more than three digits, |