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()