From 9a4be84853d37da2e7ca581b153efa7a9036c0e3 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 17 Jul 2022 13:13:14 +0000 Subject: [PATCH] Only check for string value --- src/Util/XML.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Util/XML.php b/src/Util/XML.php index e87122dc7c..e371ea3cd6 100644 --- a/src/Util/XML.php +++ b/src/Util/XML.php @@ -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); -- 2.39.5