diff options
author | tof <> | 2008-02-22 17:53:43 +0000 |
---|---|---|
committer | tof <> | 2008-02-22 17:53:43 +0000 |
commit | 922e2cc3cb7f9b79dfb8857903522bd14fadf6e5 (patch) | |
tree | 90ff7f9473abfcf276b9cf253f5573a045bd5900 /framework/Web/UI/WebControls | |
parent | 15c48caefda3882b699fbf2ee26a11f059a10715 (diff) |
Fixed Ticket#747 - TRangeValidator accept letters when type Integer is specified.
Diffstat (limited to 'framework/Web/UI/WebControls')
-rw-r--r-- | framework/Web/UI/WebControls/TRangeValidator.php | 6 |
1 files changed, 3 insertions, 3 deletions
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!=='')
|