From aa58a696655593b0a012166cfbcf34fafac6e945 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 20 Jan 2022 11:57:37 +0100 Subject: [PATCH] [Console] fix parsing escaped chars in StringInput --- Input/StringInput.php | 23 +++++++++++++++++++---- Tests/Input/StringInputTest.php | 1 + 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Input/StringInput.php b/Input/StringInput.php index eb5c07fdd..76f1d5030 100644 --- a/Input/StringInput.php +++ b/Input/StringInput.php @@ -24,7 +24,7 @@ */ class StringInput extends ArgvInput { - public const REGEX_STRING = '([^\s]+?)(?:\s|(?tokenize() parses long options with a value'], ["--long-option='foo bar'\"another\"", ['--long-option=foo baranother'], '->tokenize() parses long options with a value'], ['foo -a -ffoo --long bar', ['foo', '-a', '-ffoo', '--long', 'bar'], '->tokenize() parses when several arguments and options'], + ["--arg=\\\"'Jenny'\''s'\\\"", ["--arg=\"Jenny's\""], '->tokenize() parses quoted quotes'], ]; }