|
24 | 24 | */ |
25 | 25 | class StringInputextends ArgvInput |
26 | 26 | { |
27 | | -publicconstREGEX_STRING ='([^\s\\\\]+?)'; |
| 27 | +// @deprecated constant replaced by REGEX_UNQUOTED_STRING, to be removed in Symfony 7.0 |
| 28 | +publicconstREGEX_STRING ='([^\s]+?)(?:\s|(?<!\\\\)"|(?<!\\\\)\'|$)'; |
| 29 | +publicconstREGEX_UNQUOTED_STRING ='([^\s\\\\]+?)'; |
28 | 30 | publicconstREGEX_QUOTED_STRING ='(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\')'; |
29 | 31 |
|
30 | 32 | /** |
@@ -64,7 +66,7 @@ private function tokenize(string $input): array |
64 | 66 | $token .=$match[1].$match[2].stripcslashes(str_replace(['"\'','\'"','\'\'','""'],'',substr($match[3],1, -1))); |
65 | 67 | }elseif (preg_match('/'.self::REGEX_QUOTED_STRING.'/A',$input,$match,0,$cursor)) { |
66 | 68 | $token .=stripcslashes(substr($match[0],1, -1)); |
67 | | - }elseif (preg_match('/'.self::REGEX_STRING.'/A',$input,$match,0,$cursor)) { |
| 69 | + }elseif (preg_match('/'.self::REGEX_UNQUOTED_STRING.'/A',$input,$match,0,$cursor)) { |
68 | 70 | $token .=$match[1]; |
69 | 71 | }else { |
70 | 72 | // should never happen |
|