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@4461 a333f486-631f-4898-b8df-5754b55c2be0
glajarige 8 years ago
parent
commit
b715aeb257
1 changed files with 6 additions and 2 deletions
  1. 6 2
      sources/form/validator/validator.class.inc.php

+ 6 - 2
sources/form/validator/validator.class.inc.php

@@ -59,9 +59,13 @@ class Validator
 	{
 		if ($bWithSlashes)
 		{
-			$this->sRegExp = str_replace('/', '\\/', $this->sRegExp);
+			$sRet = '/' . str_replace('/', '\\/', $this->sRegExp) . '/';
 		}
-		return ($bWithSlashes) ? '/' . $this->sRegExp . '/' : $this->sRegExp;
+		else
+		{
+			$sRet = $this->sRegExp;
+		}
+		return $sRet;
 	}
 
 	public function GetErrorMessage()