Skip to content

Commit

Permalink
MAGETWO-64971: [GitHub][PR] Fix/xml parser issue #7339
Browse files Browse the repository at this point in the history
 - Merge Pull Request #7339 from dvynograd/magento2:fix/xml-parser-issue
  • Loading branch information
maghamed committed Feb 22, 2017
2 parents 8b16cd5 + 5bb5dd9 commit 738fa97
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/internal/Magento/Framework/Xml/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ protected function _xmlToArray($currentNode = false)
$value = ['_value' => $value, '_attribute' => $attributes];
}
if (isset($content[$node->nodeName])) {
if (!isset($content[$node->nodeName][0]) || !is_array($content[$node->nodeName][0])) {
if (
(is_string($content[$node->nodeName]) || !isset($content[$node->nodeName][0]))
|| (is_array($value) && !is_array($content[$node->nodeName][0]))
) {
$oldValue = $content[$node->nodeName];
$content[$node->nodeName] = [];
$content[$node->nodeName][] = $oldValue;
Expand Down

0 comments on commit 738fa97

Please sign in to comment.