Skip to content

Commit

Permalink
Merge pull request #90 from magento-engcom/MAGETWO-64971-PR-7339
Browse files Browse the repository at this point in the history
MAGETWO-64971: [GitHub][PR] Fix/xml parser issue #7339
  • Loading branch information
maghamed committed Feb 22, 2017
2 parents 8b16cd5 + 738fa97 commit f047d7d
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 f047d7d

Please sign in to comment.