PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 6.3.0
Defender Security – Malware Scanner, Login Security & Firewall v6.3.0
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
← All changes | framework/component/class-request.php +7 -4 5.5.1 → 6.3.0 View file →
@@ -7,9 +7,8 @@
7 7
8 8 namespace Calotes\Component;
9 9
10 10 use Calotes\Base\Model;
11 -use Calotes\Helper\HTTP;
12 11
13 12 /**
14 13 * Parse and validate request data.
15 14 */
@@ -26,12 +25,16 @@
26 25 * Constructor to initialize the object with data from the POST or GET request.
27 26 */
28 27 public function __construct() {
29 28 if ( 'POST' === defender_get_data_from_request( 'REQUEST_METHOD', 's' ) ) {
30 - $this->data = HTTP::post( 'data', '' );
29 + $this->data = defender_get_data_from_request( 'data', 'p' );
31 30 } else {
32 - $this->data = HTTP::get( 'data', '' );
31 + $this->data = defender_get_data_from_request( 'data', 'g' );
33 32 }
33 + // defender_get_data_from_request( 'data', … ) JSON-decodes; empty/malformed yields null. Central assigns get_data() to $_POST — must stay array (PHP 8+).
34 + if ( ! is_array( $this->data ) ) {
35 + $this->data = array();
36 + }
34 37 }
35 38
36 39 /**
37 40 * Retrieve the data that will be in use, it's recommended that $filters should be provided for data validation and
@@ -41,9 +44,9 @@
41 44 *
42 45 * @return array
43 46 */
44 47 public function get_data( $filters = array() ) {
45 - if ( empty( $filters ) ) {
48 + if ( ! is_array( $filters ) || array() === $filters ) {
46 49 return $this->data;
47 50 }
48 51 $data = array();
49 52 foreach ( $filters as $key => $rule ) {