Pārlūkot izejas kodu

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 gadi atpakaļ
vecāks
revīzija
8d444c3e17
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  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;
     }