X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fpsy%2Fpsysh%2Fsrc%2FInput%2FFilterOptions.php;fp=vendor%2Fpsy%2Fpsysh%2Fsrc%2FInput%2FFilterOptions.php;h=d77a04fb70b3c5834f9081f6209b0f9742b674c9;hp=113b8c94498df7128a7e75665a08fec1c67aa225;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/vendor/psy/psysh/src/Input/FilterOptions.php b/vendor/psy/psysh/src/Input/FilterOptions.php index 113b8c944..d77a04fb7 100644 --- a/vendor/psy/psysh/src/Input/FilterOptions.php +++ b/vendor/psy/psysh/src/Input/FilterOptions.php @@ -56,7 +56,7 @@ class FilterOptions } if (!$this->stringIsRegex($pattern)) { - $pattern = '/' . preg_quote($pattern, '/') . '/'; + $pattern = '/' . \preg_quote($pattern, '/') . '/'; } if ($insensitive = $input->getOption('insensitive')) { @@ -91,7 +91,7 @@ class FilterOptions */ public function match($string, array &$matches = null) { - return $this->filter === false || (preg_match($this->pattern, $string, $matches) xor $this->invert); + return $this->filter === false || (\preg_match($this->pattern, $string, $matches) xor $this->invert); } /** @@ -121,7 +121,7 @@ class FilterOptions */ private function stringIsRegex($string) { - return substr($string, 0, 1) === '/' && substr($string, -1) === '/' && strlen($string) >= 3; + return \substr($string, 0, 1) === '/' && \substr($string, -1) === '/' && \strlen($string) >= 3; } /** @@ -133,12 +133,13 @@ class FilterOptions */ private function validateRegex($pattern) { - set_error_handler(['Psy\Exception\ErrorException', 'throwException']); + \set_error_handler(['Psy\Exception\ErrorException', 'throwException']); try { - preg_match($pattern, ''); + \preg_match($pattern, ''); } catch (ErrorException $e) { - throw new RuntimeException(str_replace('preg_match(): ', 'Invalid regular expression: ', $e->getRawMessage())); + \restore_error_handler(); + throw new RuntimeException(\str_replace('preg_match(): ', 'Invalid regular expression: ', $e->getRawMessage())); } - restore_error_handler(); + \restore_error_handler(); } }