Explorar o código

#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 %!s(int64=8) %!d(string=hai) anos
pai
achega
baa7dd3124
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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;
 	}