浏览代码

#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 年之前
父节点
当前提交
baa7dd3124
共有 1 个文件被更改,包括 4 次插入0 次删除
  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)
 	public function GetRegExp($bWithSlashes = false)
 	{
 	{
+		if ($bWithSlashes)
+		{
+			$this->sRegExp = str_replace('/', '\\/', $this->sRegExp);
+		}
 		return ($bWithSlashes) ? '/' . $this->sRegExp . '/' : $this->sRegExp;
 		return ($bWithSlashes) ? '/' . $this->sRegExp . '/' : $this->sRegExp;
 	}
 	}