Eliminate use of deprecated 'get_pref()' and 'set_pref()'.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user