mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
Support validation patterns containing a forward slash
SVN:2.2.0[3828]
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user