mirror of
https://github.com/friendica/friendica
synced 2025-01-05 16:42:19 +00:00
Only check for string value
This commit is contained in:
parent
6882e70024
commit
9a4be84853
1 changed files with 4 additions and 4 deletions
|
@ -136,14 +136,14 @@ class XML
|
||||||
/**
|
/**
|
||||||
* Copies an XML object
|
* Copies an XML object
|
||||||
*
|
*
|
||||||
* @param object $source The XML source
|
* @param object|string $source The XML source
|
||||||
* @param object $target The XML target
|
* @param object $target The XML target
|
||||||
* @param string $elementname Name of the XML element of the target
|
* @param string $elementname Name of the XML element of the target
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function copy(&$source, &$target, string $elementname)
|
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));
|
$target->addChild($elementname, self::escape($source));
|
||||||
} else {
|
} else {
|
||||||
$child = $target->addChild($elementname);
|
$child = $target->addChild($elementname);
|
||||||
|
|
Loading…
Reference in a new issue