summaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorArun Persaud <arun@nubati.net>2012-05-08 21:25:49 -0700
committerArun Persaud <arun@nubati.net>2012-05-08 21:31:26 -0700
commit1e258af4136567ab30ce9b54aee751077f80590e (patch)
treed29a58e77e1ccef6527c32f83f52461569f03103 /index.php
parentd760c835fcf5444dd1a0b2997e6eb5744e0be952 (diff)
downloade-DoKo-1e258af4136567ab30ce9b54aee751077f80590e.tar.gz
e-DoKo-1e258af4136567ab30ce9b54aee751077f80590e.tar.bz2
e-DoKo-1e258af4136567ab30ce9b54aee751077f80590e.zip
BUGFIX: removed side effect from getting the user's preferences: the language used could be overwritten by another user's choise
the DB_get_Prefs($myid) functions used to set the _SESSION variable for the language, but was also called with ids that belonged to other players overwriting the language settings with that from another user
Diffstat (limited to 'index.php')
-rw-r--r--index.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/index.php b/index.php
index 4b716f8..51aa24d 100644
--- a/index.php
+++ b/index.php
@@ -58,13 +58,12 @@ if($DBopen<0)
if(myisset('language') || isset($_SESSION['language']))
{
$language = 'en';
- if(isset($_SESSION['language']))
- $language = $_SESSION['language'];
+
if(myisset('language'))
- {
- $language = $_REQUEST['language'];
- $_SESSION['language'] = $language; /* overrule preferences */
- }
+ $language = $_REQUEST['language'];
+ else if(isset($_SESSION['language']))
+ $language = $_SESSION['language'];
+
switch($language)
{
case 'de':