| @@ -1,10 +1,10 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | // phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped |
| 3 | 3 | if (!defined('ABSPATH') && !defined('MCDATAPATH')) exit; |
| 4 | 4 | |
| 5 | -if (!trait_exists('WPRProtectFWRuleRequestFunc_V648')) : | |
| 6 | -trait WPRProtectFWRuleRequestFunc_V648 { | |
| 5 | +if (!trait_exists('WPRProtectFWRuleRequestFunc_V676')) : | |
| 6 | +trait WPRProtectFWRuleRequestFunc_V676 { | |
| 7 | 7 | private function _rf_getAction() { |
| 8 | 8 | $args = $this->processRuleFunctionParams( |
| 9 | 9 | 'getAction', |
| 10 | 10 | func_num_args(), |
| @@ -54,8 +54,12 @@ | ||
| 54 | 54 | func_num_args(), |
| 55 | 55 | func_get_args() |
| 56 | 56 | ); |
| 57 | 57 | |
| 58 | + if (!empty($args)) { | |
| 59 | + return $this->request->getHeaders(...$args); | |
| 60 | + } | |
| 61 | + | |
| 58 | 62 | return $this->request->getHeaders(); |
| 59 | 63 | } |
| 60 | 64 | |
| 61 | 65 | private function _rf_getPostParams() { |
| @@ -65,9 +69,9 @@ | ||
| 65 | 69 | func_get_args() |
| 66 | 70 | ); |
| 67 | 71 | |
| 68 | 72 | if (!empty($args)) { |
| 69 | - return $this->request->getPostParams($args); | |
| 73 | + return $this->request->getPostParams(...$args); | |
| 70 | 74 | } |
| 71 | 75 | |
| 72 | 76 | return $this->request->getPostParams(); |
| 73 | 77 | } |
| @@ -89,9 +93,9 @@ | ||
| 89 | 93 | func_get_args() |
| 90 | 94 | ); |
| 91 | 95 | |
| 92 | 96 | if (!empty($args)) { |
| 93 | - return $this->request->getGetParams($args); | |
| 97 | + return $this->request->getGetParams(...$args); | |
| 94 | 98 | } |
| 95 | 99 | |
| 96 | 100 | return $this->request->getGetParams(); |
| 97 | 101 | } |
| @@ -103,9 +107,9 @@ | ||
| 103 | 107 | func_get_args() |
| 104 | 108 | ); |
| 105 | 109 | |
| 106 | 110 | if (!empty($args)) { |
| 107 | - return $this->request->getCookies($args); | |
| 111 | + return $this->request->getCookies(...$args); | |
| 108 | 112 | } |
| 109 | 113 | |
| 110 | 114 | return $this->request->getCookies(); |
| 111 | 115 | } |
| @@ -117,9 +121,9 @@ | ||
| 117 | 121 | func_get_args() |
| 118 | 122 | ); |
| 119 | 123 | |
| 120 | 124 | if (!empty($args)) { |
| 121 | - return $this->request->getFiles($args); | |
| 125 | + return $this->request->getFiles(...$args); | |
| 122 | 126 | } |
| 123 | 127 | |
| 124 | 128 | return $this->request->getFiles(); |
| 125 | 129 | } |
| @@ -131,9 +135,9 @@ | ||
| 131 | 135 | func_get_args() |
| 132 | 136 | ); |
| 133 | 137 | |
| 134 | 138 | if (!empty($args)) { |
| 135 | - return $this->request->getFileNames($args); | |
| 139 | + return $this->request->getFileNames(...$args); | |
| 136 | 140 | } |
| 137 | 141 | |
| 138 | 142 | return $this->request->getFileNames(); |
| 139 | 143 | } |
| @@ -325,8 +329,96 @@ | ||
| 325 | 329 | |
| 326 | 330 | return $this->request->getRawBody(); |
| 327 | 331 | } |
| 328 | 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 | + | |
| 329 | 421 | private function _rf_wpUserRoleLevel() { |
| 330 | 422 | $args = $this->processRuleFunctionParams( |
| 331 | 423 | 'wpUserRoleLevel', |
| 332 | 424 | func_num_args(), |
| @@ -402,9 +494,9 @@ | ||
| 402 | 494 | |
| 403 | 495 | $user = $this->_rf_getCurrentWPUser(); |
| 404 | 496 | |
| 405 | 497 | if (!array_key_exists('ID', $user)) { |
| 406 | - throw new WPRProtectRuleError_V648( | |
| 498 | + throw new WPRProtectRuleError_V676( | |
| 407 | 499 | $this->addExState("wpUserId: user's id doesn't exist") |
| 408 | 500 | ); |
| 409 | 501 | } |
| 410 | 502 | |
| @@ -440,5 +532,5 @@ | ||
| 440 | 532 | |
| 441 | 533 | return $this->_rf_currentUserCan($capability); |
| 442 | 534 | } |
| 443 | 535 | } |
| 444 | -endif; | |
| 536 | +endif; | |