| @@ -1,10 +1,10 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | if (!defined('ABSPATH') && !defined('MCDATAPATH')) exit; |
| 4 | 4 | |
| 5 | -if (!class_exists('WPRProtectRequest_V647')) : | |
| 6 | -class WPRProtectRequest_V647 { | |
| 5 | +if (!class_exists('WPRProtectRequest_V636')) : | |
| 6 | +class WPRProtectRequest_V636 { | |
| 7 | 7 | public $ip; |
| 8 | 8 | public $host = ''; |
| 9 | 9 | public $uri; |
| 10 | 10 | public $method = ''; |
| @@ -18,10 +18,10 @@ | ||
| 18 | 18 | public $json_params = array(); |
| 19 | 19 | public $raw_body = ''; |
| 20 | 20 | public $files; |
| 21 | 21 | public $respcode; |
| 22 | - public $status = WPRProtectRequest_V647::STATUS_ALLOWED; | |
| 23 | - public $category = WPRProtectRequest_V647::CATEGORY_NORMAL; | |
| 22 | + public $status = WPRProtectRequest_V636::STATUS_ALLOWED; | |
| 23 | + public $category = WPRProtectRequest_V636::CATEGORY_NORMAL; | |
| 24 | 24 | |
| 25 | 25 | public $wp_user; |
| 26 | 26 | |
| 27 | 27 | private $can_get_raw_body = false; |
| @@ -45,9 +45,9 @@ | ||
| 45 | 45 | const CATEGORY_PRIVATEIP = 80; |
| 46 | 46 | const CATEGORY_GLOBAL_BOT_BLOCKED = 90; |
| 47 | 47 | |
| 48 | 48 | public function __construct($ip_header, $config) { |
| 49 | - $this->ip = WPRProtectUtils_V647::getIP($ip_header); | |
| 49 | + $this->ip = WPRProtectUtils_V636::getIP($ip_header); | |
| 50 | 50 | $this->timestamp = time(); |
| 51 | 51 | $this->get_params = $_GET; // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 52 | 52 | $this->cookies = $_COOKIE; |
| 53 | 53 | $this->post_params = $_POST; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| @@ -123,9 +123,9 @@ | ||
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if ($this->can_decode_json) { |
| 126 | 126 | if ($this->getContentType() === "application/json" && !empty($this->raw_body)) { |
| 127 | - $_json_params = WPRProtectUtils_V647::safeDecodeJSON($this->raw_body, | |
| 127 | + $_json_params = WPRProtectUtils_V636::safeDecodeJSON($this->raw_body, | |
| 128 | 128 | true, $this->max_json_decode_depth); |
| 129 | 129 | if (isset($_json_params)) { |
| 130 | 130 | $this->json_params['JSON'] = $_json_params; |
| 131 | 131 | } |
| @@ -134,17 +134,17 @@ | ||
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | public static function blacklistedCategories() { |
| 137 | 137 | return array( |
| 138 | - WPRProtectRequest_V647::CATEGORY_BOT_BLOCKED, | |
| 139 | - WPRProtectRequest_V647::CATEGORY_COUNTRY_BLOCKED, | |
| 140 | - WPRProtectRequest_V647::CATEGORY_USER_BLACKLISTED, | |
| 141 | - WPRProtectRequest_V647::CATEGORY_GLOBAL_BOT_BLOCKED | |
| 138 | + WPRProtectRequest_V636::CATEGORY_BOT_BLOCKED, | |
| 139 | + WPRProtectRequest_V636::CATEGORY_COUNTRY_BLOCKED, | |
| 140 | + WPRProtectRequest_V636::CATEGORY_USER_BLACKLISTED, | |
| 141 | + WPRProtectRequest_V636::CATEGORY_GLOBAL_BOT_BLOCKED | |
| 142 | 142 | ); |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | public static function whitelistedCategories() { |
| 146 | - return array(WPRProtectRequest_V647::CATEGORY_WHITELISTED); | |
| 146 | + return array(WPRProtectRequest_V636::CATEGORY_WHITELISTED); | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | public function setRespCode($code) { |
| 150 | 150 | $this->respcode = $code; |
| @@ -276,13 +276,13 @@ | ||
| 276 | 276 | return $this->timestamp; |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | public function getRequestID() { |
| 280 | - if (!defined("WPR_REQUEST_ID")) { | |
| 281 | - define("WPR_REQUEST_ID", uniqid(mt_rand())); // phpcs:ignore WordPress.WP.AlternativeFunctions.rand_mt_rand | |
| 280 | + if (!defined("BV_REQUEST_ID")) { | |
| 281 | + define("BV_REQUEST_ID", uniqid(mt_rand())); // phpcs:ignore WordPress.WP.AlternativeFunctions.rand_mt_rand | |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | - return WPR_REQUEST_ID; | |
| 284 | + return BV_REQUEST_ID; | |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | public function getServerValue($key) { |
| 288 | 288 | $val = WPRHelper::getRawParam('SERVER', $key); |