Skip to content

Commit 70364a4

Browse files
author
Andrew Dolgov
committed
get_pref: do not use cache when querying prefs for specific user
1 parent 9968d46 commit 70364a4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

db-prefs.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
function get_pref($link, $pref_name, $user_id = false, $die_on_error = false) {
1111

1212
$pref_name = db_escape_string($pref_name);
13+
$prefs_cache = true;
1314

1415
if (!$user_id) {
1516
$user_id = $_SESSION["uid"];
@@ -18,7 +19,7 @@ function get_pref($link, $pref_name, $user_id = false, $die_on_error = false) {
1819
$prefs_cache = false;
1920
}
2021

21-
if (!defined('DISABLE_SESSIONS') && !SINGLE_USER_MODE) {
22+
if ($prefs_cache && !defined('DISABLE_SESSIONS') && !SINGLE_USER_MODE) {
2223
if ($_SESSION["prefs_cache"] && $_SESSION["prefs_cache"][$pref_name]) {
2324
$tuple = $_SESSION["prefs_cache"][$pref_name];
2425
return convert_pref_type($tuple["value"], $tuple["type"]);

0 commit comments

Comments
 (0)