r3253 Fixed isConfigVarChanged()
authorDenis Yeldandi <dyeldandi@gmail.com>
Wed, 10 Feb 2010 18:04:24 +0000 (18:04 +0000)
committerDenis Yeldandi <dyeldandi@gmail.com>
Wed, 10 Feb 2010 18:04:24 +0000 (18:04 +0000)
inc/config.php
inc/ophandlers.php

index 26b6b84d5c4b3ff76126a7129d34c850263a370d..4270398d682a88a4492792316368475129a5454a 100644 (file)
@@ -76,9 +76,9 @@ function isConfigVarChanged($varname, $varvalue) {
                throw new InvalidArgException('$varname', $varname, 'Empty variable name');
        if (!isset ($configCache[$varname])) return true;
        if ($configCache[$varname]['vartype'] == 'uint')
-               return $configCache[$varname]['varvalue'] === 0 + $varvalue;
+               return $configCache[$varname]['varvalue'] !== 0 + $varvalue;
        else
-               return $configCache[$varname]['varvalue'] === $varvalue;
+               return $configCache[$varname]['varvalue'] !== $varvalue;
 }
 
 function getConfigVar ($varname = '')
index b1499cc514c71fc009bca5b558603d3990ffa90c..67479d75170b388a7961acde4f00c0e992d7f832 100644 (file)
@@ -934,7 +934,7 @@ function updateUI ()
                $varvalue = $_REQUEST["${i}_varvalue"];
 
                // If form value = value in DB, don't bother updating DB
-               if (isConfigVarChanged($varname, $varvalue))
+               if (!isConfigVarChanged($varname, $varvalue))
                        continue;
 
                // Note if the queries succeed or not, it determines which page they see.
@@ -961,7 +961,7 @@ function saveMyPreferences ()
                $varvalue = $_REQUEST["${i}_varvalue"];
 
                // If form value = value in DB, don't bother updating DB
-               if (isConfigVarChanged($varname, $varvalue))
+               if (!isConfigVarChanged($varname, $varvalue))
                        continue;
                // Note if the queries succeed or not, it determines which page they see.
                try {