浏览代码

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 年之前
父节点
当前提交
8d444c3e17
共有 1 个文件被更改,包括 2 次插入2 次删除
  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;
     }