From 325d9fb3b0b5f41e181cd7a53df52a02fc6aeba4 Mon Sep 17 00:00:00 2001 From: Dekel Barzilay Date: Mon, 20 May 2013 01:56:34 +0300 Subject: [PATCH] This is a fix for YAML error from issue #8093 I have problems at the moments setting up PHPUnit testing environment, so any help with testing it would be appreciated. --- src/Symfony/Component/Yaml/Parser.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Symfony/Component/Yaml/Parser.php b/src/Symfony/Component/Yaml/Parser.php index 680b50349c92e..14b53426a7b54 100644 --- a/src/Symfony/Component/Yaml/Parser.php +++ b/src/Symfony/Component/Yaml/Parser.php @@ -111,6 +111,7 @@ public function parse($value, $exceptionOnInvalidType = false, $objectSupport = $data[] = $this->parseValue($values['value'], $exceptionOnInvalidType, $objectSupport); } } + $context = null; } elseif (preg_match('#^(?P'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\[\{].*?) *\:(\s+(?P.+?))?\s*$#u', $this->currentLine, $values)) { if ($context && 'sequence' == $context) { throw new ParseException('You cannot define a mapping item when in a sequence'); @@ -189,6 +190,7 @@ public function parse($value, $exceptionOnInvalidType = false, $objectSupport = $data[$key] = $this->parseValue($values['value'], $exceptionOnInvalidType, $objectSupport); } } + $context = null; } else { // 1-liner optionally followed by newline $lineCount = count($this->lines);