]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/XML.php
Friendica copyright changed from 2023 to 2034
[friendica.git] / src / Util / XML.php
index e5fa4009f3dcf23936715ec0d1aea6b36bcf83b9..58ba84c4a7fc42686bb1e3279d8d2fa76423ada7 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2023, the Friendica project
+ * @copyright Copyright (C) 2010-2024, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -26,7 +26,6 @@ use DOMElement;
 use DOMNode;
 use DOMXPath;
 use Friendica\Core\Logger;
-use Friendica\Core\System;
 use SimpleXMLElement;
 
 /**
@@ -118,7 +117,7 @@ class XML
                                                $namespace = null;
                                        }
 
-                                       $element->addAttribute($attr_key, $attr_value, $namespace);
+                                       $element->addAttribute($attr_key, $attr_value ?? '', $namespace);
                                }
 
                                continue;
@@ -451,7 +450,7 @@ class XML
                $x = @simplexml_load_string($s);
                if (!$x) {
                        if (!$suppress_log) {
-                               Logger::error('Error(s) while parsing XML string.', ['callstack' => System::callstack()]);
+                               Logger::error('Error(s) while parsing XML string.');
                                foreach (libxml_get_errors() as $err) {
                                        Logger::info('libxml error', ['code' => $err->code, 'position' => $err->line . ':' . $err->column, 'message' => $err->message]);
                                }