1 | <?php |
||
4 | class Request extends Base |
||
5 | { |
||
6 | private $magicQuotesGpc = false; |
||
7 | |||
8 | public function pollute() |
||
13 | |||
14 | public function enableMagicQuotesGpc() |
||
18 | |||
19 | public function disableMagicQuotesGpc() |
||
23 | |||
24 | /** |
||
25 | * Inject $_FILES to global variables. |
||
26 | * |
||
27 | * The naming rule when injected |
||
28 | * |
||
29 | * $_FILES['upfile']['tmp_name'] => $upfile |
||
30 | * $_FILES['upfile']['size'] => $upfile_size |
||
31 | * $_FILES['upfile']['type'] => $upfile_type |
||
32 | * |
||
33 | */ |
||
34 | private function injectFileToGlobal() |
||
51 | |||
52 | /** |
||
53 | * Inject `EGPCS` to global variables. |
||
54 | * |
||
55 | * `EGPCS` means $_ENV, $_GET, $_POST, $_COOKIE and $_SERVER. |
||
56 | * |
||
57 | * If beforehand call `enableMagicQuotesGpc()`, |
||
58 | * applies `addslashes` $_GET, $_POST, $_COOKIE and those inject variables. |
||
59 | */ |
||
60 | private function injectEGPCSToGlobal() |
||
105 | |||
106 | /** |
||
107 | * @return array |
||
108 | */ |
||
109 | protected function getInjectVariables() |
||
113 | |||
114 | /** |
||
115 | * Recursively applies `addslashes` to each element of the array recursive. |
||
116 | * |
||
117 | * This method is **bang** . |
||
118 | */ |
||
119 | private function addSlashesRecursive(&$theVariables) |
||
128 | |||
129 | protected function injectToGlobal(array $theVariables) |
||
139 | } |
||
140 |