diff options
-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!=='')
|