aboutsummaryrefslogtreecommitdiff
path: root/classes/Db_Prefs.php
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2024-11-19 16:46:48 +0000
committerAndrew Dolgov <fox@fakecake.org>2024-11-19 16:46:48 +0000
commit4bdd926a1c6238fe49cc3a8b26e7ce1539ebb764 (patch)
tree19deb331e4204003b11b88cc2f1e98cc2440b402 /classes/Db_Prefs.php
parent394d606fe977a331f733c62e5509469c2eb3ef31 (diff)
parent154abc61a0f81bee7757fc57e594f3f4bccc0fdf (diff)
Merge branch 'feature/replace-get_pref-and-set_pref' into 'master'
Eliminate use of deprecated 'get_pref()' and 'set_pref()'. See merge request tt-rss/tt-rss!75
Diffstat (limited to 'classes/Db_Prefs.php')
-rw-r--r--classes/Db_Prefs.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/classes/Db_Prefs.php b/classes/Db_Prefs.php
index 209ef58c1..55be4f6f6 100644
--- a/classes/Db_Prefs.php
+++ b/classes/Db_Prefs.php
@@ -6,13 +6,13 @@ class Db_Prefs {
* @return bool|int|null|string
*/
function read(string $pref_name, ?int $user_id = null, bool $die_on_error = false) {
- return get_pref($pref_name, $user_id);
+ return Prefs::get($pref_name, $user_id ?: $_SESSION['uid'], $_SESSION['profile'] ?? null);
}
/**
* @param mixed $value
*/
function write(string $pref_name, $value, ?int $user_id = null, bool $strip_tags = true): bool {
- return set_pref($pref_name, $value, $user_id, $strip_tags);
+ return Prefs::set($pref_name, $value, $user_id ?: $_SESSION['uid'], $_SESSION['profile'] ?? null, $strip_tags);
}
}