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 +102 -9 5.536.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_V553')) :
5 -trait WPRProtectFWRuleRequestFunc_V553 {
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 }
@@ -324,8 +329,96 @@
324 329
325 330 return $this->request->getRawBody();
326 331 }
327 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 +
328 421 private function _rf_wpUserRoleLevel() {
329 422 $args = $this->processRuleFunctionParams(
330 423 'wpUserRoleLevel',
331 424 func_num_args(),
@@ -401,9 +494,9 @@
401 494
402 495 $user = $this->_rf_getCurrentWPUser();
403 496
404 497 if (!array_key_exists('ID', $user)) {
405 - throw new WPRProtectRuleError_V553(
498 + throw new WPRProtectRuleError_V676(
406 499 $this->addExState("wpUserId: user's id doesn't exist")
407 500 );
408 501 }
409 502
@@ -439,5 +532,5 @@
439 532
440 533 return $this->_rf_currentUserCan($capability);
441 534 }
442 535 }
443 -endif;
536 +endif;