mirror of
https://github.com/e107inc/e107.git
synced 2025-08-08 07:36:32 +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:
@@ -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;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user