| @@ -51,9 +51,10 @@ | ||
| 51 | 51 | public static function safePregMatch($pattern, $subject, &$matches = null, $flags = 0, $offset = 0) { |
| 52 | 52 | if (!is_string($pattern) || !is_string($subject)) { |
| 53 | 53 | return false; |
| 54 | 54 | } |
| 55 | - return preg_match($pattern, $subject, $matches, $flags, $offset); | |
| 55 | + $result = @preg_match($pattern, $subject, $matches, $flags, $offset); | |
| 56 | + return $result === false ? false : $result; | |
| 56 | 57 | } |
| 57 | 58 | |
| 58 | 59 | # XNOTE - The below function assumes valid input |
| 59 | 60 | # $array should be an array and $keys should be an array of string, or integer data |
| @@ -407,5 +408,5 @@ | ||
| 407 | 408 | return $value !== null ? self::maybeUnslashValue($value) : null; |
| 408 | 409 | } |
| 409 | 410 | // phpcs:enable WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
| 410 | 411 | } |
| 411 | -endif; | |
| 412 | +endif; | |