Support validation patterns contains a forward slash

SVN:trunk[3827]
This commit is contained in:
Denis Flaven
2015-11-25 16:49:20 +00:00
parent 908b442b26
commit c9576c696a

View File

@@ -937,8 +937,8 @@ EOF
public function ReadParam(&$aValues)
{
parent::ReadParam($aValues);
if (($this->sValidationPattern != '') &&(!preg_match('/'.$this->sValidationPattern.'/', $aValues[$this->sCode])) )
$sPattern = '/'.str_replace('/', '\/', $this->sValidationPattern).'/'; // Escape the forward slashes since they are used as delimiters for preg_match
if (($this->sValidationPattern != '') && (!preg_match($sPattern, $aValues[$this->sCode])) )
{
$aValues[$this->sCode] = $this->defaultValue;
}