From: Andrew Dolgov Date: Sat, 27 Apr 2013 13:12:48 +0000 (+0400) Subject: fix startup_gettext() trying to get configured language before session is initialized X-Git-Tag: 1.7.9~25^2~68 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=1ee4900a54b9aba69d115a5f4a513fef31655452;p=tt-rss.git fix startup_gettext() trying to get configured language before session is initialized --- diff --git a/include/functions.php b/include/functions.php index 6337dbbd..5da657f2 100644 --- a/include/functions.php +++ b/include/functions.php @@ -95,8 +95,11 @@ $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) {