Дополнительные проверки переменных
This commit is contained in:
parent
2713745b62
commit
cdd0028ecb
@ -8,12 +8,16 @@
|
||||
class input
|
||||
{
|
||||
public static function get($name) {
|
||||
rtrim($_GET[$name]);
|
||||
return (isset($_GET[$name]) AND !empty($_GET[$name])) ? $_GET[$name] : null;
|
||||
$var = rtrim(filter_input(INPUT_GET,$name));
|
||||
if (isset($var) AND !empty($var))
|
||||
return $var;
|
||||
else return null;
|
||||
}
|
||||
|
||||
public static function post($name) {
|
||||
rtrim($_POST[$name]);
|
||||
return (isset($_POST[$name]) AND !empty($_POST[$name])) ? $_POST[$name] : null;
|
||||
$var = rtrim(filter_input(INPUT_POST,$name));
|
||||
if (isset($var) AND !empty($var))
|
||||
return $var;
|
||||
else return null;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user