verify: quote the regexp before using them
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3858 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -409,7 +409,8 @@ class verify
|
|||||||
*/
|
*/
|
||||||
public static function staticIsAllowedChars ($val, $allowedChars)
|
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]) &&
|
if (isset ($matches[0]) &&
|
||||||
mb_strlen ($matches[0]) === mb_strlen ($val))
|
mb_strlen ($matches[0]) === mb_strlen ($val))
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user