Browse Source

Carried over modification made to file_prefs to distinguish
between a 0 value, and an unset value using ===.

Certain prefs were unsaveable after the XSS changes, which
cast zero values to ints (instead of strings), causing
them to pass the $set_to == '' check, and thus be treated
as an unset value, rather than a value of 0.

Erin Schnabel 22 năm trước cách đây
mục cha
commit
8d444c3e17
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      functions/db_prefs.php

+ 2 - 2
functions/db_prefs.php

@@ -298,10 +298,10 @@ function setPref($data_dir, $username, $string, $set_to) {
     global $prefs_cache;
 
     if (isset($prefs_cache[$string]) && ($prefs_cache[$string] == $set_to)) {
-        return;
+	return;
     }
 
-    if ($set_to == '') {
+    if ($set_to === '') {
         removePref($data_dir, $username, $string);
         return;
     }