diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-07-11 20:07:00 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-07-11 20:07:00 +0000 |
commit | 01ae6f500ec5d8fb56ceef826d56f1fda6082bea (patch) | |
tree | 395b5bad60920f57f2f860072dcd2568f507daaa | |
parent | e4c7378ef3cadf005e15caa39933f6fec71e5852 (diff) | |
download | brdo-01ae6f500ec5d8fb56ceef826d56f1fda6082bea.tar.gz brdo-01ae6f500ec5d8fb56ceef826d56f1fda6082bea.tar.bz2 |
#158452 by kenji_kun, patch by myself: GET['q'] might not be defined at the language bootstrap phase
-rw-r--r-- | includes/language.inc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/includes/language.inc b/includes/language.inc index a9c84eb2c..b5c56f7d7 100644 --- a/includes/language.inc +++ b/includes/language.inc @@ -30,9 +30,12 @@ function language_initialize() { case LANGUAGE_NEGOTIATION_PATH_DEFAULT: case LANGUAGE_NEGOTIATION_PATH: $languages = language_list('prefix'); - $args = explode('/', $_GET['q']); + // $_GET['q'] might not be available at this time, because + // path initialization runs after the language bootstrap phase. + $args = isset($_GET['q']) ? explode('/', $_GET['q']) : array(); $language = array_shift($args); if (isset($languages[$language])) { + // Rebuild $GET['q'] with the language removed. $_GET['q'] = implode('/', $args); return $languages[$language]; } |