From 110f999d05e2bedaf7ed3ec8dd03046f5c0de7de Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 28 Aug 2014 03:42:35 +0200 Subject: [PATCH] [Yaml] fixed mapping keys containing a quoted # --- src/Symfony/Component/Yaml/Parser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Yaml/Parser.php b/src/Symfony/Component/Yaml/Parser.php index d0aae87ab9..addb387a48 100644 --- a/src/Symfony/Component/Yaml/Parser.php +++ b/src/Symfony/Component/Yaml/Parser.php @@ -114,7 +114,7 @@ class Parser $data[] = $this->parseValue($values['value'], $exceptionOnInvalidType, $objectSupport); } } - } elseif (preg_match('#^(?P'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\[\{].*?) *\:(\s+(?P.+?))?\s*$#u', $this->currentLine, $values) && false === strpos($values['key'],' #')) { + } elseif (preg_match('#^(?P'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\[\{].*?) *\:(\s+(?P.+?))?\s*$#u', $this->currentLine, $values) && (false === strpos($values['key'],' #') || in_array($values['key'][0], array('"', "'")))) { if ($context && 'sequence' == $context) { throw new ParseException('You cannot define a mapping item when in a sequence'); }