PluginProbe
WebTotem Security / 2.3.46
WebTotem Security v2.3.46
3.0.1 3.0.0 trunk 1.0 1.1 1.2 1.3 1.3.1 1.3.2 1.3.3 2.0 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.1 2.2.2 2.2.3 2.2.4 All 109 releases
wt-security / library / Request.php

Request.php in WebTotem Security 2.3.46, at library/Request.php

43 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php defined('ABSPATH') or die("Protected By WT!");
2
3
4 class WTSEC_LIBRARY_Request
5 {
6
7 public $request;
8
9 public $method;
10
11 public function __construct()
12 {
13 $this->request = [];
14 $this->request += $this->clean($_GET);
15 $this->request += $this->clean($_POST);
16 $this->request = (object)$this->request;
17 $this->method = $this->clean($_SERVER['REQUEST_METHOD']);
18 }
19
20 public function clean($data)
21 {
22 if (is_array($data)) {
23 foreach ($data as $key => $value) {
24 unset($data[$key]);
25 $data[$this->clean($key)] = $this->clean($value);
26 }
27 } else {
28 $data = htmlspecialchars(strip_tags($data), ENT_COMPAT, 'UTF-8');
29 }
30 return $data;
31 }
32
33 public function __get($name)
34 {
35 if (!is_null($this->request) && property_exists($this->request, $name)) {
36 return $this->request->$name;
37 }
38 if (isset($this->$name)) {
39 return $this->$name;
40 }
41 return "";
42 }
43 }