From 3bda16ce6c1eaf8c2edd53aabbd8459227599b5e Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Tue, 1 Aug 2017 13:40:12 +0000 Subject: [PATCH] verify: quote the regexp before using them git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3858 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- verify.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/verify.php b/verify.php index 1586814..9b4ef75 100644 --- a/verify.php +++ b/verify.php @@ -409,7 +409,8 @@ class verify */ public static function staticIsAllowedChars ($val, $allowedChars) { - preg_match ('/^['.$allowedChars.']+/u', $val, $matches); + $allowedChars = preg_quote ($allowedChars, "#"); + preg_match ('#^['.$allowedChars.']+#u', $val, $matches); if (isset ($matches[0]) && mb_strlen ($matches[0]) === mb_strlen ($val)) return true;