X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FUtil%2FXML.php;h=c35f19b8a8e584619b4b14ca9ea8349c09d1da0e;hb=e1863951986ba5be173758324a00652bc5af870c;hp=321e2e96a611e8bb07f706575f01274d7b6bd79e;hpb=3fcd54615125f167b83d419330ca7fca87b48aa1;p=friendica.git diff --git a/src/Util/XML.php b/src/Util/XML.php index 321e2e96a6..c35f19b8a8 100644 --- a/src/Util/XML.php +++ b/src/Util/XML.php @@ -118,7 +118,7 @@ class XML $namespace = null; } - $element->addAttribute($attr_key, $attr_value, $namespace); + $element->addAttribute($attr_key, $attr_value ?? '', $namespace); } continue; @@ -397,7 +397,7 @@ class XML } $repeated_tag_index[$tag . '_' . $level]++; } else { // If it is not an array... - $current[$tag] = [$current[$tag], $result]; //...Make it an array using using the existing value and the new value + $current[$tag] = [$current[$tag], $result]; //...Make it an array using the existing value and the new value $repeated_tag_index[$tag . '_' . $level] = 1; if ($priority == 'tag' and $get_attributes) { if (isset($current[$tag.'_attr'])) { // The attribute of the last(0th) tag must be moved as well @@ -441,7 +441,7 @@ class XML * Parse XML string * * @param string $s XML string to parse into object - * @param boolean $suppress_log Whether to supressing logging + * @param boolean $suppress_log Whether to suppressing logging * @return SimpleXMLElement|bool SimpleXMLElement or false on failure */ public static function parseString(string $s, bool $suppress_log = false)