PluginProbe ʕ •ᴥ•ʔ
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel / trunk
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel vtrunk
trunk 0.9.0 0.9.1 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.2.0 1.2.1 1.2.10 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 1.4.14 1.4.15 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0
wp-all-export / src / Http / Request.php
wp-all-export / src / Http Last commit date
JsonResponse.php 9 years ago Request.php 3 weeks ago Response.php 3 weeks ago Router.php 8 years ago
Request.php
44 lines
1 <?php
2
3 namespace Wpae\Http;
4
5
6 class Request
7 {
8 private $content;
9
10 public function __construct($content)
11 {
12 $this->content = $content;
13 }
14
15 public function getRawContent()
16 {
17 return $this->content;
18 }
19
20 public function getJsonParams()
21 {
22 if(!empty($this->content) && $this->content !== "null") {
23
24 $jsonDecodedContent = json_decode($this->content, true);
25
26 if (is_null($jsonDecodedContent)) {
27 throw new \Exception('Invalid JON Provided');
28 }
29
30 return $jsonDecodedContent;
31 }
32 }
33
34 public function get($element, $default = null)
35 {
36 // phpcs:disable WordPress.Security.NonceVerification.Recommended -- generic request wrapper; nonce verification is the caller's responsibility
37 if(isset($_GET[$element])) {
38 return sanitize_text_field( wp_unslash( $_GET[$element] ) );
39 } else {
40 return $default;
41 }
42 // phpcs:enable WordPress.Security.NonceVerification.Recommended
43 }
44 }