Skip to content
Snippets Groups Projects
Commit 01ae6f50 authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#158452 by kenji_kun, patch by myself: GET['q'] might not be defined at the...

#158452 by kenji_kun, patch by myself: GET['q'] might not be defined at the language bootstrap phase
parent e4c7378e
No related branches found
No related tags found
No related merge requests found
......@@ -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];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment