Merge branch 'bugfix/user-language' into 'master'

Get rid of the 'language' session variable.

See merge request tt-rss/tt-rss!104
This commit is contained in:
Andrew Dolgov
2025-03-04 19:11:53 +00:00
2 changed files with 2 additions and 12 deletions

View File

@@ -207,14 +207,10 @@ class Pref_Prefs extends Handler_Protected {
}
break;
case Prefs::USER_LANGUAGE:
if (!$need_reload) $need_reload = $_SESSION["language"] != $value;
break;
case Prefs::USER_CSS_THEME:
if (!$need_reload) $need_reload = Prefs::get(Prefs::USER_CSS_THEME, $_SESSION['uid'], $profile) != $value;
case Prefs::USER_LANGUAGE:
if (!$need_reload) $need_reload = Prefs::get($pref_name, $_SESSION['uid'], $profile) != $value;
break;
case Prefs::BLACKLISTED_TAGS:
$cats = FeedItem_Common::normalize_categories(explode(",", $value));
asort($cats);

View File

@@ -125,12 +125,6 @@ class UserHelper {
if (empty($_SESSION["csrf_token"]))
$_SESSION["csrf_token"] = bin2hex(get_random_bytes(16));
if (Config::get_schema_version() >= 120) {
// TODO: USER_LANGUAGE is currently profile-specific, so we should pass it in here,
// but $_SESSION['profile'] isn't currently available until after the login flow completes.
$_SESSION["language"] = Prefs::get(Prefs::USER_LANGUAGE, $owner_uid);
}
}
static function load_user_plugins(int $owner_uid, ?PluginHost $pluginhost = null): void {