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 21
21
*/
22
22
class Inline
23
23
{
24
- const REGEX_QUOTED_STRING = '(?:"([^" \\\\]*(?: \\\\.[^" \\\\]*)* )"| \'([^ \']*(?: \'\'[^ \']*)* ) \') ' ;
24
+ const REGEX_QUOTED_STRING = '(?:"([^" \\\\]*+ (?: \\\\.[^" \\\\]*+)*+ )"| \'([^ \']*+ (?: \'\'[^ \']*+)*+ ) \') ' ;
25
25
26
26
private static $ exceptionOnInvalidType = false ;
27
27
private static $ objectSupport = false ;
Original file line number Diff line number Diff line change @@ -410,4 +410,14 @@ public function testNotSupportedMissingValue()
410
410
{
411
411
Inline::parse ('{this, is not, supported} ' );
412
412
}
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
+ }
413
423
}
You can’t perform that action at this time.
0 commit comments