mirror of
https://github.com/Mibew/mibew.git
synced 2025-02-07 00:14:40 +03:00
Improve validation of incoming params
This commit is contained in:
parent
9f94e73dd2
commit
9a0c9f42a1
@ -68,12 +68,12 @@ function myiconv($in_enc, $out_enc, $string)
|
||||
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user