summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortof <>2008-02-22 17:53:43 +0000
committertof <>2008-02-22 17:53:43 +0000
commit922e2cc3cb7f9b79dfb8857903522bd14fadf6e5 (patch)
tree90ff7f9473abfcf276b9cf253f5573a045bd5900
parent15c48caefda3882b699fbf2ee26a11f059a10715 (diff)
Fixed Ticket#747 - TRangeValidator accept letters when type Integer is specified.
-rw-r--r--HISTORY1
-rw-r--r--framework/Web/UI/WebControls/TRangeValidator.php6
2 files changed, 4 insertions, 3 deletions
diff --git a/HISTORY b/HISTORY
index 89353f6c..d2b9c397 100644
--- a/HISTORY
+++ b/HISTORY
@@ -4,6 +4,7 @@ BUG: Ticket#707 - TPropertyAccess sets property twice on object when using sette
BUG: Ticket#719 - TAutoCompleter should not trigger Validation if CausesValidation=False (Christophe)
BUG: Ticket#736 - Files never created in clientscript.php (Qiang)
BUG: Ticket#744 - Callback error handling is improved (Qiang)
+BUG: Ticket#747 - TRangeValidator accept letters when type Integer is specified (Christophe)
BUG: Ticket#750 - The "expire" parameter is used inconsistently in cache modules (Qiang)
BUG: Ticket#753 - Themes not allways being set (Qiang)
BUG: Ticket#776 - Logout button should not cause validation in blog tutorial (Qiang)
diff --git a/framework/Web/UI/WebControls/TRangeValidator.php b/framework/Web/UI/WebControls/TRangeValidator.php
index 36dbcdca..13f5465c 100644
--- a/framework/Web/UI/WebControls/TRangeValidator.php
+++ b/framework/Web/UI/WebControls/TRangeValidator.php
@@ -200,8 +200,8 @@ class TRangeValidator extends TBaseValidator
$minValue=$this->getMinValue();
$maxValue=$this->getMaxValue();
+ $valid=preg_match('/^[-+]?[0-9]+$/',trim($value));
$value=intval($value);
- $valid=true;
if($minValue!=='')
$valid=$valid && $this->isGreaterThan($value, intval($minValue));
if($maxValue!=='')
@@ -228,9 +228,9 @@ class TRangeValidator extends TBaseValidator
{
$minValue=$this->getMinValue();
$maxValue=$this->getMaxValue();
-
+
+ $valid=preg_match('/^[-+]?([0-9]*\.)?[0-9]+([eE][-+]?[0-9]+)?$/',trim($value));
$value=floatval($value);
- $valid=true;
if($minValue!=='')
$valid=$valid && $this->isGreaterThan($value,floatval($minValue));
if($maxValue!=='')