More sensible detection of empty widget submissions. Still does not address the...
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 17 Apr 2008 20:03:36 +0000 (20:03 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 17 Apr 2008 20:03:36 +0000 (20:03 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13054 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/options.php

index fb0d8aa..4ee59c7 100644 (file)
@@ -210,7 +210,7 @@ class SquirrelOption {
 
         /* Check for a new value. */
         if ( !sqgetGlobalVar("new_$name", $this->new_value, SQ_POST ) ) {
 
         /* Check for a new value. */
         if ( !sqgetGlobalVar("new_$name", $this->new_value, SQ_POST ) ) {
-            $this->new_value = '';
+            $this->new_value = NULL;
         }
 
         /* Set the default save function. */
         }
 
         /* Set the default save function. */
@@ -330,7 +330,7 @@ class SquirrelOption {
         global $color;
 
         // Use new value if available
         global $color;
 
         // Use new value if available
-        if (!empty($this->new_value)) {
+        if (!is_null($this->new_value)) {
             $tempValue = $this->value;
             $this->value = $this->new_value;
         }
             $tempValue = $this->value;
             $this->value = $this->new_value;
         }
@@ -392,7 +392,7 @@ class SquirrelOption {
         $result .= $this->post_script;
 
         // put correct value back if need be
         $result .= $this->post_script;
 
         // put correct value back if need be
-        if (!empty($this->new_value)) {
+        if (!is_null($this->new_value)) {
             $this->value = $tempValue;
         }
 
             $this->value = $tempValue;
         }