]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix startup_gettext() trying to get configured language before session is initialized
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 27 Apr 2013 13:12:48 +0000 (17:12 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 27 Apr 2013 13:12:48 +0000 (17:12 +0400)
include/functions.php

index 6337dbbdeb6617013a135fa194f911225fac5f32..5da657f2d72fa47bde62c5a04fc5a5da8c7f4948 100644 (file)
                        $lang = _TRANSLATION_OVERRIDE_DEFAULT;
                }
 
-               if ($_SESSION["language"] && $_SESSION["language"] != "auto") {
-                       $lang = $_SESSION["language"];
+               // startup_gettext() is called before session_start() so we can't rely
+               // on $_SESSION['language'] here.
+
+               if ($_COOKIE["ttrss_lang"] && $_COOKIE["ttrss_lang"] != "auto") {
+                       $lang = $_COOKIE["ttrss_lang"];
                }
 
                if ($lang) {