summaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2014-06-21 18:50:55 +0100
committerGreg Roach <fisharebest@gmail.com>2014-06-21 18:50:55 +0100
commitf7d1f95a420a9b7bb0f08d0f277f0310947c8990 (patch)
tree9c9295ac40c80a5da3b9fe24685e579c7492ce7f /library
parentec6bfc786035865d378b6cbafbdd4e293c618862 (diff)
downloadwebtrees-f7d1f95a420a9b7bb0f08d0f277f0310947c8990.tar.gz
webtrees-f7d1f95a420a9b7bb0f08d0f277f0310947c8990.tar.bz2
webtrees-f7d1f95a420a9b7bb0f08d0f277f0310947c8990.zip
#58 - do not update superglobals
Diffstat (limited to 'library')
-rw-r--r--library/WT/I18N.php15
1 files changed, 7 insertions, 8 deletions
diff --git a/library/WT/I18N.php b/library/WT/I18N.php
index 024d53e62e..749bc6b078 100644
--- a/library/WT/I18N.php
+++ b/library/WT/I18N.php
@@ -95,27 +95,26 @@ class WT_I18N {
$installed_languages=self::installed_languages();
if (is_null($locale) || !array_key_exists($locale, $installed_languages)) {
// Automatic locale selection.
- if (isset($_GET['lang']) && array_key_exists($_GET['lang'], $installed_languages)) {
+ $locale = WT_Filter::get('lang');
+ if ($locale && array_key_exists($locale, $installed_languages)) {
// Requested in the URL?
- $locale=$_GET['lang'];
- unset($_GET['lang']);
if (\WT\Auth::id()) {
\WT\Auth::user()->setSetting('language', $locale);
}
} elseif (array_key_exists($WT_SESSION->locale, $installed_languages)) {
// Rembered from a previous visit?
- $locale=$WT_SESSION->locale;
+ $locale = $WT_SESSION->locale;
} else {
// Browser preference takes priority over gedcom default
if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
- $prefs=explode(',', str_replace(' ', '', $_SERVER['HTTP_ACCEPT_LANGUAGE']));
+ $prefs = explode(',', str_replace(' ', '', $_SERVER['HTTP_ACCEPT_LANGUAGE']));
} else {
- $prefs=array();
+ $prefs = array();
}
if (WT_GED_ID) {
// Add the tree’s default language as a low-priority
- $locale=get_gedcom_setting(WT_GED_ID, 'LANGUAGE');
- $prefs[]=$locale.';q=0.2';
+ $locale = get_gedcom_setting(WT_GED_ID, 'LANGUAGE');
+ $prefs[] = $locale.';q=0.2';
}
$prefs2=array();
foreach ($prefs as $pref) {