From 59fc0b63a889d96adaf28d2581ba7c1fd6f55418 Mon Sep 17 00:00:00 2001 From: pdontthink Date: Thu, 17 Apr 2008 20:03:36 +0000 Subject: [PATCH 1/1] More sensible detection of empty widget submissions. Still does not address the fact that select lists and checkboxes may not appear in the POST at all when they are empty in the HTML form git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13054 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/options.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/functions/options.php b/functions/options.php index fb0d8aa6..4ee59c73 100644 --- a/functions/options.php +++ b/functions/options.php @@ -210,7 +210,7 @@ class SquirrelOption { /* 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. */ @@ -330,7 +330,7 @@ class SquirrelOption { 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; } @@ -392,7 +392,7 @@ class SquirrelOption { $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; } -- 2.25.1