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