summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY1
-rw-r--r--framework/Web/Javascripts/source/prado/validator/validation3.js2
-rw-r--r--framework/Web/UI/WebControls/TRegularExpressionValidator.php4
3 files changed, 4 insertions, 3 deletions
diff --git a/HISTORY b/HISTORY
index 5f49d582..e8256553 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,4 +1,5 @@
Version 3.1.7 To be released
+BUG: Issue#80 - Inconsistencies in TRegularExpressionValidator (Christophe)
BUG: Issue#151 - TTextBox fails to display inital line break (Yves)
BUG: Issue#153 - Bug with calls like MyActiveRedorc->withText()->withUser()->find(...) and null result (Christophe)
BUG: Issue#157 - Enabled does not work properly on TActiveRadioButton/CheckBoxList controls (Bradley, Carl)
diff --git a/framework/Web/Javascripts/source/prado/validator/validation3.js b/framework/Web/Javascripts/source/prado/validator/validation3.js
index afec8e15..b1bf1a03 100644
--- a/framework/Web/Javascripts/source/prado/validator/validation3.js
+++ b/framework/Web/Javascripts/source/prado/validator/validation3.js
@@ -1707,7 +1707,7 @@ Prado.WebUI.TRegularExpressionValidator = Class.extend(Prado.WebUI.TBaseValidato
if (value.length <= 0)
return true;
- var rx = new RegExp(this.options.ValidationExpression,this.options.PatternModifiers);
+ var rx = new RegExp('^'+this.options.ValidationExpression+'$',this.options.PatternModifiers);
var matches = rx.exec(value);
return (matches != null && value == matches[0]);
}
diff --git a/framework/Web/UI/WebControls/TRegularExpressionValidator.php b/framework/Web/UI/WebControls/TRegularExpressionValidator.php
index be861e45..6855c6de 100644
--- a/framework/Web/UI/WebControls/TRegularExpressionValidator.php
+++ b/framework/Web/UI/WebControls/TRegularExpressionValidator.php
@@ -4,7 +4,7 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI.WebControls
@@ -86,7 +86,7 @@ class TRegularExpressionValidator extends TBaseValidator
{
if(($value=$this->getValidationValue($this->getValidationTarget()))==='')
return true;
- if(($expression=$this->getRegularExpression())!=='')
+ if(($expression=addcslashes($this->getRegularExpression(),"/"))!=='')
{
$mods = $this->getPatternModifiers();
return preg_match("/^$expression\$/{$mods}",$value);