X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FUtil%2FXML.php;h=5355d30f995b36bfa77fe8268c1fd7362ef601ab;hb=60d9d7f5e07095c0bd60e6a03350181328637d94;hp=c2721d24716a479e6875b6f99c56bfa8df613995;hpb=21f3a56c424a85fbfea023e577e24420d960cdb3;p=friendica.git diff --git a/src/Util/XML.php b/src/Util/XML.php index c2721d2471..5355d30f99 100644 --- a/src/Util/XML.php +++ b/src/Util/XML.php @@ -1,6 +1,6 @@ $value) { @@ -125,7 +126,7 @@ class XML if (!is_array($value)) { $element = $xml->addChild($key, self::escape($value ?? ''), $namespace); - } elseif (is_array($value)) { + } else { $element = $xml->addChild($key, null, $namespace); self::fromArray($value, $element, $remove_header, $namespaces, false); } @@ -270,7 +271,7 @@ class XML } if (!function_exists('xml_parser_create')) { - Logger::notice('Xml::toArray: parser function missing'); + Logger::error('Xml::toArray: parser function missing'); return []; } @@ -285,8 +286,8 @@ class XML $parser = @xml_parser_create(); } - if (! $parser) { - Logger::notice('Xml::toArray: xml_parser_create: no resource'); + if (!$parser) { + Logger::warning('Xml::toArray: xml_parser_create: no resource'); return []; } @@ -535,7 +536,7 @@ class XML * * @param string $str * @return string Escaped text. - * @todo Move this generic method to Util\Strings and also rewrite all other findingd + * @todo Move this generic method to Util\Strings and also rewrite all other occurrences */ public static function escape(string $str): string { @@ -547,7 +548,7 @@ class XML * * @param string $s xml escaped text * @return string unescaped text - * @todo Move this generic method to Util\Strings and also rewrite all other findingd + * @todo Move this generic method to Util\Strings and also rewrite all other occurrences */ public static function unescape(string $s): string {