(Retrofit from trunk) #497 Portal : Could not update object due to "Warning: preg_match(): Unknown modifier '/'"

SVN:2.3[4462]
This commit is contained in:
Guillaume Lajarige
2016-10-21 08:46:38 +00:00
parent 45f4d8f625
commit 49f72aee28

View File

@@ -57,7 +57,15 @@ class Validator
*/
public function GetRegExp($bWithSlashes = false)
{
return ($bWithSlashes) ? '/' . $this->sRegExp . '/' : $this->sRegExp;
if ($bWithSlashes)
{
$sRet = '/' . str_replace('/', '\\/', $this->sRegExp) . '/';
}
else
{
$sRet = $this->sRegExp;
}
return $sRet;
}
public function GetErrorMessage()