# wt-security/1.3.3/library/Request.php

WebTotem Security, version 1.3.3. 43 lines.

- Page: https://pluginprobe.com/plugins/wt-security/1.3.3/code/library/Request.php
- Raw: https://pluginprobe.com/plugins/wt-security/1.3.3/raw/library/Request.php
- Modified: 2020-01-28T20:07:50+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wt-security/1.3.3/code/library/Request.php#L10-L20`.

```php
<?php defined('ABSPATH') or die("Protected By Webtotem Wordpress Security!");


class WTSEC_LIBRARY_Request
{

    public $request;

    public $method;

    public function __construct()
    {
        $this->request = [];
        $this->request += $this->clean($_GET);
        $this->request += $this->clean($_POST);
        $this->request = (object)$this->request;
        $this->method = $this->clean($_SERVER['REQUEST_METHOD']);
    }

    public function clean($data)
    {
        if (is_array($data)) {
            foreach ($data as $key => $value) {
                unset($data[$key]);
                $data[$this->clean($key)] = $this->clean($value);
            }
        } else {
            $data = htmlspecialchars(strip_tags($data), ENT_COMPAT, 'UTF-8');
        }
        return $data;
    }

    public function __get($name)
    {
        if (!is_null($this->request) && array_key_exists($name, $this->request)) {
            return $this->request->$name;
        }
        if (isset($this->$name)) {
            return $this->$name;
        }
        return "";
    }
}
```
