Support validation patterns containing a forward slash

SVN:2.2.0[3828]
This commit is contained in:
Denis Flaven
2015-11-25 16:50:57 +00:00
parent 97809190de
commit 424f08d650

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;
}