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/misc.php +28 -10 5.566.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('WPRProtectFWRuleMiscFunc_V556')) :
5 -trait WPRProtectFWRuleMiscFunc_V556 {
5 +if (!trait_exists('WPRProtectFWRuleMiscFunc_V676')) :
6 +trait WPRProtectFWRuleMiscFunc_V676 {
6 7 private function _rf_isTrue() {
7 8 $args = $this->processRuleFunctionParams(
8 9 'isTrue',
9 10 func_num_args(),
@@ -36,12 +37,28 @@
36 37 );
37 38 $value = $args[0];
38 39
39 40 $file = $this->_rf_getFiles($value);
40 - if (is_array($file) && in_array('tmp_name', $file)) {
41 - return is_uploaded_file($file['tmp_name']);
41 + if (!is_array($file) || !array_key_exists('tmp_name', $file)) {
42 + return false;
42 43 }
43 -
44 +
45 + $paths = array($file['tmp_name']);
46 + while (!empty($paths)) {
47 + $path = array_pop($paths);
48 +
49 + if (is_array($path)) {
50 + foreach ($path as $nested_path) {
51 + $paths[] = $nested_path;
52 + }
53 + continue;
54 + }
55 +
56 + if (is_string($path) && $path !== '' && is_uploaded_file($path)) {
57 + return true;
58 + }
59 + }
60 +
44 61 return false;
45 62 }
46 63
47 64 private function _rf_getVarValue() {
@@ -54,9 +71,9 @@
54 71 );
55 72 $name = $args[0];
56 73
57 74 if (!array_key_exists($name, $this->variables)) {
58 - throw new WPRProtectRuleError_V556(
75 + throw new WPRProtectRuleError_V676(
59 76 $this->addExState("UndefinedVariableError: " . $name . " is not defined.")
60 77 );
61 78 }
62 79
@@ -115,9 +132,9 @@
115 132 return false;
116 133 }
117 134 $resp = WPRHelper::safePregMatch((string) $pattern, (string) $subject);
118 135 if ($resp === false) {
119 - throw new WPRProtectRuleError_V556(
136 + throw new WPRProtectRuleError_V676(
120 137 $this->addExState('BVHelper::safePregMatch' . serialize($subject))
121 138 );
122 139 } elseif ($resp > 0) {
123 140 return true;
@@ -156,9 +173,9 @@
156 173 return $count;
157 174 }
158 175 $count = preg_match_all((string) $pattern, (string) $subject, $matches);
159 176 if ($count === false) {
160 - throw new WPRProtectRuleError_V556(
177 + throw new WPRProtectRuleError_V676(
161 178 $this->addExState("preg_match_all: " . serialize($subject))
162 179 );
163 180 }
164 181 return $count;
@@ -182,9 +199,9 @@
182 199 return $count;
183 200 }
184 201 $count = preg_match_all((string) $pattern, (string) $subject, $matches);
185 202 if ($count === false) {
186 - throw new WPRProtectRuleError_V556(
203 + throw new WPRProtectRuleError_V676(
187 204 $this->addExState("preg_match_all: " . serialize($subject))
188 205 );
189 206 }
190 207 return $count;
@@ -377,8 +394,9 @@
377 394 func_num_args(),
378 395 func_get_args()
379 396 );
380 397
398 + // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace -- Needed for stack trace functionality
381 399 return debug_backtrace();
382 400 }
383 401
384 402 private function _rf_getFilesFromBacktrace() {
@@ -521,5 +539,5 @@
521 539
522 540 return gettype($value);
523 541 }
524 542 }
525 -endif;
543 +endif;