From a749b8c0006e6154fa9b7f70aac69dfc4a49441f Mon Sep 17 00:00:00 2001 From: "Fedor A. Fetisov" Date: Thu, 7 Nov 2013 02:59:24 +0400 Subject: [PATCH] Improve validation of incoming params --- src/mibew/libs/common/verification.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mibew/libs/common/verification.php b/src/mibew/libs/common/verification.php index ebe1c12b..d09935f7 100644 --- a/src/mibew/libs/common/verification.php +++ b/src/mibew/libs/common/verification.php @@ -17,12 +17,12 @@ function verifyparam($name, $regexp, $default = null) { - if (isset($_GET[$name])) { + if (isset($_GET[$name]) && is_scalar($_GET[$name])) { $val = $_GET[$name]; if (preg_match($regexp, $val)) return $val; - } else if (isset($_POST[$name])) { + } else if (isset($_POST[$name]) && is_scalar($_POST[$name])) { $val = $_POST[$name]; if (preg_match($regexp, $val)) return $val;