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 | |
parent | 15c48caefda3882b699fbf2ee26a11f059a10715 (diff) |
Fixed Ticket#747 - TRangeValidator accept letters when type Integer is specified.
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TRangeValidator.php | 6 |
2 files changed, 4 insertions, 3 deletions
@@ -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!=='')
|