File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
src/Symfony/Component/Yaml Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 2121 */
2222class Inline
2323{
24- const REGEX_QUOTED_STRING = '(?:"([^" \\\\]*(?: \\\\.[^" \\\\]*)* )"| \'([^ \']*(?: \'\'[^ \']*)* ) \') ' ;
24+ const REGEX_QUOTED_STRING = '(?:"([^" \\\\]*+ (?: \\\\.[^" \\\\]*+)*+ )"| \'([^ \']*+ (?: \'\'[^ \']*+)*+ ) \') ' ;
2525
2626 private static $ exceptionOnInvalidType = false ;
2727 private static $ objectSupport = false ;
Original file line number Diff line number Diff line change @@ -410,4 +410,14 @@ public function testNotSupportedMissingValue()
410410 {
411411 Inline::parse ('{this, is not, supported} ' );
412412 }
413+
414+ public function testVeryLongQuotedStrings ()
415+ {
416+ $ longStringWithQuotes = str_repeat ("x \r\n\\\"x \"x " , 1000 );
417+
418+ $ yamlString = Inline::dump (array ('longStringWithQuotes ' => $ longStringWithQuotes ));
419+ $ arrayFromYaml = Inline::parse ($ yamlString );
420+
421+ $ this ->assertEquals ($ longStringWithQuotes , $ arrayFromYaml ['longStringWithQuotes ' ]);
422+ }
413423}
You can’t perform that action at this time.
0 commit comments