]> git.mxchange.org Git - friendica.git/commitdiff
Only check for string value
authorMichael <heluecht@pirati.ca>
Sun, 17 Jul 2022 13:13:14 +0000 (13:13 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 17 Jul 2022 13:13:14 +0000 (13:13 +0000)
src/Util/XML.php

index e87122dc7ce6cde85b235a55b9f759af6cb04872..e371ea3cd628df93f6396027fcc595691fd2156e 100644 (file)
@@ -136,14 +136,14 @@ class XML
        /**
         * Copies an XML object
         *
-        * @param object $source      The XML source
-        * @param object $target      The XML target
-        * @param string $elementname Name of the XML element of the target
+        * @param object|string $source      The XML source
+        * @param object        $target      The XML target
+        * @param string        $elementname Name of the XML element of the target
         * @return void
         */
        public static function copy(&$source, &$target, string $elementname)
        {
-               if (is_string($source) && count($source->children()) == 0) {
+               if (is_string($source)) {
                        $target->addChild($elementname, self::escape($source));
                } else {
                        $child = $target->addChild($elementname);