From e48ad8cb61e57580f3a3592daf1761821ebb3dd9 Mon Sep 17 00:00:00 2001 From: Guillaume Lajarige Date: Fri, 21 Oct 2016 08:29:36 +0000 Subject: [PATCH] #497 Portal : Could not update object due to "Warning: preg_match(): Unknown modifier '/'" SVN:trunk[4461] --- sources/form/validator/validator.class.inc.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sources/form/validator/validator.class.inc.php b/sources/form/validator/validator.class.inc.php index 83ff8351a..4026f206d 100644 --- a/sources/form/validator/validator.class.inc.php +++ b/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()