-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathInput.php
More file actions
39 lines (37 loc) · 1.18 KB
/
Copy pathInput.php
File metadata and controls
39 lines (37 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
namespace FeatherBB\Core\Interfaces;
use FeatherBB\Core\Utils;
class Input extends \Statical\BaseProxy
{
public static function file($name)
{
return isset($_FILES[$name]) && $_FILES[$name]['size'] ? $_FILES[$name] : null;
}
public static function getParam($key, $default = null, $sanitize = true)
{
$result = Request::getParam($key, $default);
if ($sanitize) {
$result = htmlspecialchars($result, ENT_QUOTES, 'UTF-8');
$result = Utils::trim($result);
}
return $result;
}
public static function post($key, $default = null, $sanitize = false)
{
$result = Request::getParsedBodyParam($key, $default);
if ($sanitize) {
$result = htmlspecialchars($result, ENT_QUOTES, 'UTF-8');
$result = Utils::trim($result);
}
return $result;
}
public static function query($key, $default = null, $sanitize = true)
{
$result = Request::getQueryParam($key, $default);
if ($sanitize) {
$result = htmlspecialchars($result, ENT_QUOTES, 'UTF-8');
$result = Utils::trim($result);
}
return $result;
}
}