From 8803801d5d0443c89e4e325e800ba0c2113885fe Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Fri, 2 Feb 2024 20:25:07 +0100 Subject: Fix incorrect backslash escaping of `\\` The regular expression part `\\` must be written as `\\\\`, not `\\\` in a PHP string variable. Although both variants (`\\\\` and `\\\`) will be passed as `\` to the regex engine in this specific case, it's correct to use 4 backslashes, as the PHP manual tells you: https://www.php.net/manual/en/regexp.reference.escape.php --- core/namespace/Parsers/FunctionParser.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/namespace/Parsers') diff --git a/core/namespace/Parsers/FunctionParser.php b/core/namespace/Parsers/FunctionParser.php index 5b2656e..02570a0 100644 --- a/core/namespace/Parsers/FunctionParser.php +++ b/core/namespace/Parsers/FunctionParser.php @@ -26,8 +26,8 @@ class FunctionParser implements ParserInterface { private const ARGUMENT_PATTERN_PARTIAL = '(? # Either a quoted string or a plain number (?["\']) # Either a single or double quote - (?>[^"\'\\\]++ # String between the quotes - | [\\\]. # A `\` followed by anything but literal newline + (?>[^"\'\\\\]++ # String between the quotes + | [\\\\]. # A `\` followed by anything but literal newline | (?!\k)["\'] # A quote, but not our opening quote )*+ \k # Closing quote (same as opening quote) -- cgit v1.2.3