| @@ -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('WPRProtectFWRuleWPFunc_V662')) : | |
| 6 | -trait WPRProtectFWRuleWPFunc_V662 { | |
| 5 | +if (!trait_exists('WPRProtectFWRuleWPFunc_V676')) : | |
| 6 | +trait WPRProtectFWRuleWPFunc_V676 { | |
| 7 | 7 | private function _rf_sanitizeUser() { |
| 8 | 8 | $args = $this->processRuleFunctionParams( |
| 9 | 9 | 'sanitizeUser', |
| 10 | 10 | func_num_args(), |
| @@ -14,10 +14,10 @@ | ||
| 14 | 14 | ); |
| 15 | 15 | $username = $args[0]; |
| 16 | 16 | $strict = $args[1]; |
| 17 | 17 | |
| 18 | - if (!function_exists('sanitize_user') || !WPRProtectUtils_V662::haveMupluginsLoaded()) { | |
| 19 | - throw new WPRProtectRuleError_V662( | |
| 18 | + if (!function_exists('sanitize_user') || !WPRProtectUtils_V676::haveMupluginsLoaded()) { | |
| 19 | + throw new WPRProtectRuleError_V676( | |
| 20 | 20 | $this->addExState("sanitizeUser: Func sanitize_user doesn't exist.") |
| 21 | 21 | ); |
| 22 | 22 | } |
| 23 | 23 | |
| @@ -32,10 +32,10 @@ | ||
| 32 | 32 | 1 |
| 33 | 33 | ); |
| 34 | 34 | $data = $args[0]; |
| 35 | 35 | |
| 36 | - if (!function_exists('maybe_serialize') || !WPRProtectUtils_V662::haveMupluginsLoaded()) { | |
| 37 | - throw new WPRProtectRuleError_V662( | |
| 36 | + if (!function_exists('maybe_serialize') || !WPRProtectUtils_V676::haveMupluginsLoaded()) { | |
| 37 | + throw new WPRProtectRuleError_V676( | |
| 38 | 38 | $this->addExState("maybeSerialize: Func maybe_serialize doesn't exist.") |
| 39 | 39 | ); |
| 40 | 40 | } |
| 41 | 41 | |
| @@ -48,10 +48,10 @@ | ||
| 48 | 48 | func_num_args(), |
| 49 | 49 | func_get_args() |
| 50 | 50 | ); |
| 51 | 51 | |
| 52 | - if (!function_exists('is_user_logged_in') || !WPRProtectUtils_V662::havePluginsLoaded()) { | |
| 53 | - throw new WPRProtectRuleError_V662( | |
| 52 | + if (!function_exists('is_user_logged_in') || !WPRProtectUtils_V676::havePluginsLoaded()) { | |
| 53 | + throw new WPRProtectRuleError_V676( | |
| 54 | 54 | $this->addExState("isUserLoggedIn: Func is_user_logged_in doesn't exist.") |
| 55 | 55 | ); |
| 56 | 56 | } |
| 57 | 57 | |
| @@ -64,15 +64,15 @@ | ||
| 64 | 64 | func_num_args(), |
| 65 | 65 | func_get_args() |
| 66 | 66 | ); |
| 67 | 67 | |
| 68 | - if (!function_exists('wp_get_current_user') || !WPRProtectUtils_V662::havePluginsLoaded()) { | |
| 69 | - throw new WPRProtectRuleError_V662( | |
| 68 | + if (!function_exists('wp_get_current_user') || !WPRProtectUtils_V676::havePluginsLoaded()) { | |
| 69 | + throw new WPRProtectRuleError_V676( | |
| 70 | 70 | $this->addExState("getCurrentWPUser: Func wp_get_current_user doesn't exist.") |
| 71 | 71 | ); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - return WPRProtectFWRuleEngine_V662::toAllowedType(wp_get_current_user()); | |
| 74 | + return WPRProtectFWRuleEngine_V676::toAllowedType(wp_get_current_user()); | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | private function _rf_currentUserCan() { |
| 78 | 78 | $args = $this->processRuleFunctionParams( |
| @@ -85,10 +85,10 @@ | ||
| 85 | 85 | $capability = $args[0]; |
| 86 | 86 | $arg1 = isset($args[1]) ? $args[1] : null; |
| 87 | 87 | $arg2 = isset($args[2]) ? $args[2] : null; |
| 88 | 88 | |
| 89 | - if (!function_exists('current_user_can') || !WPRProtectUtils_V662::havePluginsLoaded()) { | |
| 90 | - throw new WPRProtectRuleError_V662( | |
| 89 | + if (!function_exists('current_user_can') || !WPRProtectUtils_V676::havePluginsLoaded()) { | |
| 90 | + throw new WPRProtectRuleError_V676( | |
| 91 | 91 | $this->addExState("currentUserCan: Required funcs doesn't exist.") |
| 92 | 92 | ); |
| 93 | 93 | } |
| 94 | 94 | |
| @@ -113,10 +113,10 @@ | ||
| 113 | 113 | ); |
| 114 | 114 | $field = $args[0]; |
| 115 | 115 | $value = $args[1]; |
| 116 | 116 | |
| 117 | - if (!function_exists('get_user_by') || !WPRProtectUtils_V662::havePluginsLoaded()) { | |
| 118 | - throw new WPRProtectRuleError_V662( | |
| 117 | + if (!function_exists('get_user_by') || !WPRProtectUtils_V676::havePluginsLoaded()) { | |
| 118 | + throw new WPRProtectRuleError_V676( | |
| 119 | 119 | $this->addExState("getUserBy: Func get_user_by doesn't exist") |
| 120 | 120 | ); |
| 121 | 121 | } |
| 122 | 122 | |
| @@ -121,14 +121,14 @@ | ||
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | if ($field === 'ID' || $field === 'id') { |
| 124 | 124 | if (!is_string($value) && !is_int($value)) { |
| 125 | - throw new WPRProtectRuleError_V662( | |
| 125 | + throw new WPRProtectRuleError_V676( | |
| 126 | 126 | $this->addExState("getUserBy: Value must be a valid string or an integer") |
| 127 | 127 | ); |
| 128 | 128 | } |
| 129 | 129 | } elseif (!is_string($value)) { |
| 130 | - throw new WPRProtectRuleError_V662( | |
| 130 | + throw new WPRProtectRuleError_V676( | |
| 131 | 131 | $this->addExState("getUserBy: Value must be a valid string") |
| 132 | 132 | ); |
| 133 | 133 | } |
| 134 | 134 | |
| @@ -136,9 +136,9 @@ | ||
| 136 | 136 | if (false === $user) { |
| 137 | 137 | return null; |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - return WPRProtectFWRuleEngine_V662::toAllowedType($user); | |
| 140 | + return WPRProtectFWRuleEngine_V676::toAllowedType($user); | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | private function _rf_getCurrentWPUserCapabilities() { |
| 144 | 144 | $args = $this->processRuleFunctionParams( |
| @@ -149,14 +149,14 @@ | ||
| 149 | 149 | |
| 150 | 150 | $user = $this->_rf_getCurrentWPUser(); |
| 151 | 151 | |
| 152 | 152 | if (!array_key_exists("allcaps", $user)) { |
| 153 | - throw new WPRProtectRuleError_V662( | |
| 153 | + throw new WPRProtectRuleError_V676( | |
| 154 | 154 | $this->addExState("getCurrentWPUserCapabilities: allcaps doesn't exist in user.") |
| 155 | 155 | ); |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | - return WPRProtectFWRuleEngine_V662::toAllowedType($user["allcaps"]); | |
| 158 | + return WPRProtectFWRuleEngine_V676::toAllowedType($user["allcaps"]); | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | private function _rf_getUserCapabilities() { |
| 162 | 162 | $args = $this->processRuleFunctionParams( |
| @@ -172,14 +172,14 @@ | ||
| 172 | 172 | return array(); |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | if (!array_key_exists("allcaps", $user)) { |
| 176 | - throw new WPRProtectRuleError_V662( | |
| 176 | + throw new WPRProtectRuleError_V676( | |
| 177 | 177 | $this->addExState("getUserCapabilities: allcaps doesn't exist in user.") |
| 178 | 178 | ); |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | - return WPRProtectFWRuleEngine_V662::toAllowedType($user["allcaps"]); | |
| 181 | + return WPRProtectFWRuleEngine_V676::toAllowedType($user["allcaps"]); | |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | private function _rf_getDefaultUserRole() { |
| 185 | 185 | $args = $this->processRuleFunctionParams( |
| @@ -201,15 +201,15 @@ | ||
| 201 | 201 | ); |
| 202 | 202 | $option = $args[0]; |
| 203 | 203 | $default_value = isset($args[1]) ? $args[1] : false; |
| 204 | 204 | |
| 205 | - if (!function_exists('get_option') || !WPRProtectUtils_V662::haveMupluginsLoaded()) { | |
| 206 | - throw new WPRProtectRuleError_V662( | |
| 205 | + if (!function_exists('get_option') || !WPRProtectUtils_V676::haveMupluginsLoaded()) { | |
| 206 | + throw new WPRProtectRuleError_V676( | |
| 207 | 207 | $this->addExState("getOption: Func get_option doesn't exist.") |
| 208 | 208 | ); |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | - return WPRProtectFWRuleEngine_V662::toAllowedType(get_option($option, $default_value)); | |
| 211 | + return WPRProtectFWRuleEngine_V676::toAllowedType(get_option($option, $default_value)); | |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | private function _rf_checkPasswordResetKey() { |
| 215 | 215 | $args = $this->processRuleFunctionParams( |
| @@ -221,10 +221,10 @@ | ||
| 221 | 221 | ); |
| 222 | 222 | $key = $args[0]; |
| 223 | 223 | $login = $args[1]; |
| 224 | 224 | |
| 225 | - if (!function_exists('check_password_reset_key') || !WPRProtectUtils_V662::havePluginsLoaded()) { | |
| 226 | - throw new WPRProtectRuleError_V662( | |
| 225 | + if (!function_exists('check_password_reset_key') || !WPRProtectUtils_V676::havePluginsLoaded()) { | |
| 226 | + throw new WPRProtectRuleError_V676( | |
| 227 | 227 | $this->addExState("checkPasswordResetKey: Func check_password_reset_key doesn't exist.") |
| 228 | 228 | ); |
| 229 | 229 | } |
| 230 | 230 | |
| @@ -230,9 +230,9 @@ | ||
| 230 | 230 | |
| 231 | 231 | $user = check_password_reset_key($key, $login); |
| 232 | 232 | |
| 233 | 233 | if (is_a($user, "WP_User")) { |
| 234 | - return WPRProtectFWRuleEngine_V662::toAllowedType($user); | |
| 234 | + return WPRProtectFWRuleEngine_V676::toAllowedType($user); | |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | return null; |
| 238 | 238 | } |
| @@ -285,16 +285,16 @@ | ||
| 285 | 285 | 1 |
| 286 | 286 | ); |
| 287 | 287 | $value = $args[0]; |
| 288 | 288 | |
| 289 | - if (!function_exists('wp_unslash') || !WPRProtectUtils_V662::haveMuPluginsLoaded()) { | |
| 290 | - throw new WPRProtectRuleError_V662( | |
| 289 | + if (!function_exists('wp_unslash') || !WPRProtectUtils_V676::haveMuPluginsLoaded()) { | |
| 290 | + throw new WPRProtectRuleError_V676( | |
| 291 | 291 | $this->addExState("wpUnslash: Func wp_unslash doesn't exist.") |
| 292 | 292 | ); |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | if (!is_string($value) && !is_array($value)) { |
| 296 | - throw new WPRProtectRuleError_V662( | |
| 296 | + throw new WPRProtectRuleError_V676( | |
| 297 | 297 | $this->addExState("wpUnslash: Value must be a valid string or an array") |
| 298 | 298 | ); |
| 299 | 299 | } |
| 300 | 300 | |
| @@ -308,9 +308,9 @@ | ||
| 308 | 308 | func_get_args() |
| 309 | 309 | ); |
| 310 | 310 | |
| 311 | 311 | if (!defined('COOKIEHASH')) { |
| 312 | - throw new WPRProtectRuleError_V662( | |
| 312 | + throw new WPRProtectRuleError_V676( | |
| 313 | 313 | $this->addExState("parseResetPassCookie: COOKIEHASH is not defined.") |
| 314 | 314 | ); |
| 315 | 315 | } |
| 316 | 316 | |