PluginProbe
The WP Remote WordPress Plugin / 6.76
The WP Remote WordPress Plugin v6.76
6.76 6.72 6.69 6.65 6.62 6.48 6.47 4.87 4.97 5.05 5.09 5.16 5.22 5.24 5.25 5.38 5.41 5.42 5.45 5.47 5.53 5.56 5.65 5.68 5.72 All 54 releases
← All changes | protect/fw/rule/functions/request.php +132 -9 5.426.76 View file →
@@ -1,9 +1,10 @@
1 1 <?php
2 +// phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped
2 3 if (!defined('ABSPATH') && !defined('MCDATAPATH')) exit;
3 4
4 -if (!trait_exists('WPRProtectFWRuleRequestFunc_V542')) :
5 -trait WPRProtectFWRuleRequestFunc_V542 {
5 +if (!trait_exists('WPRProtectFWRuleRequestFunc_V676')) :
6 +trait WPRProtectFWRuleRequestFunc_V676 {
6 7 private function _rf_getAction() {
7 8 $args = $this->processRuleFunctionParams(
8 9 'getAction',
9 10 func_num_args(),
@@ -53,8 +54,12 @@
53 54 func_num_args(),
54 55 func_get_args()
55 56 );
56 57
58 + if (!empty($args)) {
59 + return $this->request->getHeaders(...$args);
60 + }
61 +
57 62 return $this->request->getHeaders();
58 63 }
59 64
60 65 private function _rf_getPostParams() {
@@ -64,9 +69,9 @@
64 69 func_get_args()
65 70 );
66 71
67 72 if (!empty($args)) {
68 - return $this->request->getPostParams($args);
73 + return $this->request->getPostParams(...$args);
69 74 }
70 75
71 76 return $this->request->getPostParams();
72 77 }
@@ -88,9 +93,9 @@
88 93 func_get_args()
89 94 );
90 95
91 96 if (!empty($args)) {
92 - return $this->request->getGetParams($args);
97 + return $this->request->getGetParams(...$args);
93 98 }
94 99
95 100 return $this->request->getGetParams();
96 101 }
@@ -102,9 +107,9 @@
102 107 func_get_args()
103 108 );
104 109
105 110 if (!empty($args)) {
106 - return $this->request->getCookies($args);
111 + return $this->request->getCookies(...$args);
107 112 }
108 113
109 114 return $this->request->getCookies();
110 115 }
@@ -116,9 +121,9 @@
116 121 func_get_args()
117 122 );
118 123
119 124 if (!empty($args)) {
120 - return $this->request->getFiles($args);
125 + return $this->request->getFiles(...$args);
121 126 }
122 127
123 128 return $this->request->getFiles();
124 129 }
@@ -130,9 +135,9 @@
130 135 func_get_args()
131 136 );
132 137
133 138 if (!empty($args)) {
134 - return $this->request->getFileNames($args);
139 + return $this->request->getFileNames(...$args);
135 140 }
136 141
137 142 return $this->request->getFileNames();
138 143 }
@@ -176,8 +181,18 @@
176 181
177 182 return $this->request->getTimeStamp();
178 183 }
179 184
185 + private function _rf_getContentType() {
186 + $args = $this->processRuleFunctionParams(
187 + 'getContentType',
188 + func_num_args(),
189 + func_get_args()
190 + );
191 +
192 + return $this->request->getContentType();
193 + }
194 +
180 195 private function _rf_getAllParams() {
181 196 $args = $this->processRuleFunctionParams(
182 197 'getAllParams',
183 198 func_num_args(),
@@ -294,8 +309,116 @@
294 309
295 310 return $this->request->getPostParamsV2();
296 311 }
297 312
313 + private function _rf_getJsonParams() {
314 + $this->processRuleFunctionParams(
315 + 'getJsonParams',
316 + func_num_args(),
317 + func_get_args()
318 + );
319 +
320 + return $this->request->getJsonParams();
321 + }
322 +
323 + private function _rf_getRawBody() {
324 + $this->processRuleFunctionParams(
325 + 'getRawBody',
326 + func_num_args(),
327 + func_get_args()
328 + );
329 +
330 + return $this->request->getRawBody();
331 + }
332 +
333 + private function _rf_getUploadedFileContent() {
334 + $args = $this->processRuleFunctionParams(
335 + 'getUploadedFileContent',
336 + func_num_args(),
337 + func_get_args(),
338 + 2
339 + );
340 +
341 + return $this->request->getUploadedFileContent(
342 + $args[0],
343 + $args[1],
344 + isset($args[2]) ? $args[2] : null
345 + );
346 + }
347 +
348 + private function _rf_getUploadedFileName() {
349 + $args = $this->processRuleFunctionParams(
350 + 'getUploadedFileName',
351 + func_num_args(),
352 + func_get_args(),
353 + 1
354 + );
355 +
356 + return $this->request->getUploadedFileMeta(
357 + $args[0],
358 + 'name',
359 + isset($args[1]) ? $args[1] : null
360 + );
361 + }
362 +
363 + private function _rf_getUploadedFileType() {
364 + $args = $this->processRuleFunctionParams(
365 + 'getUploadedFileType',
366 + func_num_args(),
367 + func_get_args(),
368 + 1
369 + );
370 +
371 + return $this->request->getUploadedFileMeta(
372 + $args[0],
373 + 'type',
374 + isset($args[1]) ? $args[1] : null
375 + );
376 + }
377 +
378 + private function _rf_getUploadedFileSize() {
379 + $args = $this->processRuleFunctionParams(
380 + 'getUploadedFileSize',
381 + func_num_args(),
382 + func_get_args(),
383 + 1
384 + );
385 +
386 + return $this->request->getUploadedFileMeta(
387 + $args[0],
388 + 'size',
389 + isset($args[1]) ? $args[1] : null
390 + );
391 + }
392 +
393 + private function _rf_getUploadedFileError() {
394 + $args = $this->processRuleFunctionParams(
395 + 'getUploadedFileError',
396 + func_num_args(),
397 + func_get_args(),
398 + 1
399 + );
400 +
401 + return $this->request->getUploadedFileMeta(
402 + $args[0],
403 + 'error',
404 + isset($args[1]) ? $args[1] : null
405 + );
406 + }
407 +
408 + private function _rf_getUploadedFileContentStatus() {
409 + $args = $this->processRuleFunctionParams(
410 + 'getUploadedFileContentStatus',
411 + func_num_args(),
412 + func_get_args()
413 + );
414 +
415 + return $this->request->getUploadedFileContentStatus(
416 + isset($args[0]) ? $args[0] : null,
417 + isset($args[1]) ? $args[1] : null
418 + );
419 + }
420 +
298 421 private function _rf_wpUserRoleLevel() {
299 422 $args = $this->processRuleFunctionParams(
300 423 'wpUserRoleLevel',
301 424 func_num_args(),
@@ -371,9 +494,9 @@
371 494
372 495 $user = $this->_rf_getCurrentWPUser();
373 496
374 497 if (!array_key_exists('ID', $user)) {
375 - throw new WPRProtectRuleError_V542(
498 + throw new WPRProtectRuleError_V676(
376 499 $this->addExState("wpUserId: user's id doesn't exist")
377 500 );
378 501 }
379 502
@@ -409,5 +532,5 @@
409 532
410 533 return $this->_rf_currentUserCan($capability);
411 534 }
412 535 }
413 -endif;
536 +endif;