Browse Source

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

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4460 a333f486-631f-4898-b8df-5754b55c2be0
glajarige 8 years ago
parent
commit
baa7dd3124
1 changed files with 4 additions and 0 deletions
  1. 4 0
      sources/form/validator/validator.class.inc.php

+ 4 - 0
sources/form/validator/validator.class.inc.php

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