From 2621fe795551b99c6c6ca9d5c2b7115345decca1 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 25 Feb 2021 12:53:20 +0300 Subject: fix get_pref always using default profile; remove unneeded code from db_prefs --- include/functions.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'include/functions.php') diff --git a/include/functions.php b/include/functions.php index 3ed024d11..8e819fac0 100644 --- a/include/functions.php +++ b/include/functions.php @@ -43,13 +43,11 @@ } function get_pref(string $pref_name, int $owner_uid = null) { - return Prefs::get($pref_name, $owner_uid ? $owner_uid : $_SESSION["uid"]); - //return Db_Prefs::get()->read($pref_name, $user_id, $die_on_error); + return Prefs::get($pref_name, $owner_uid ? $owner_uid : $_SESSION["uid"], $_SESSION["profile"] ?? null); } function set_pref(string $pref_name, $value, int $owner_uid = null, bool $strip_tags = true) { return Prefs::set($pref_name, $value, $owner_uid ? $owner_uid : $_SESSION["uid"], $_SESSION["profile"] ?? null, $strip_tags); - //return Db_Prefs::get()->write($pref_name, $value, $user_id, $strip_tags); } function get_translations() { -- cgit v1.2.3