1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-07 23:26:41 +02:00

Merge pull request #3028 from Deltik/fix-3027

Fixes #3026. PHP 7.2 consistency hack in xmlClass::xml2array()
This commit is contained in:
Cameron
2018-02-06 11:24:15 -08:00
committed by GitHub

View File

@@ -561,16 +561,17 @@ class xmlClass
//loop through tags //loop through tags
foreach ($tags as $tag) foreach ($tags as $tag)
{ {
if(is_int($tag)) continue;
switch($tag) switch($tag)
{ {
case '@attributes': case '@attributes':
$tmp = (array) $xml->attributes(); $tmp = (array) $xml->attributes();
$ret['@attributes'] = $tmp['@attributes']; $ret['@attributes'] = $tmp['@attributes'];
if($count_tags == 1) //only attributes & possible value if($count_tags == 1 || ['@attributes', 0] === $tags) //only attributes & possible value
{ {
$ret[$this->_optValueKey] = trim((string) $xml); $ret[$this->_optValueKey] = trim((string) $xml);
return $ret; //return $ret;
} }
break; break;