From f77e642f244b5dce37da3964ae7163a6c45e28b2 Mon Sep 17 00:00:00 2001 From: gwoo Date: Mon, 29 Jan 2007 22:04:26 +0000 Subject: [PATCH] fix for xml helper git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4346 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/view/helpers/xml.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/cake/libs/view/helpers/xml.php b/cake/libs/view/helpers/xml.php index be7bc01b1..c4617b4c9 100644 --- a/cake/libs/view/helpers/xml.php +++ b/cake/libs/view/helpers/xml.php @@ -207,10 +207,10 @@ class XmlHelper extends AppHelper { * @return string XML */ function __composeContent($content) { - $out = ''; if (is_string($content)) { - $out .= $content; + return $content; } elseif (is_array($content)) { + $out = ''; $keys = array_keys($content); $count = count($keys); for ($i = 0; $i < $count; $i++) { @@ -226,14 +226,17 @@ class XmlHelper extends AppHelper { //$out .= $this->elem($keys[$i] } } + return $out; } elseif (is_object($content) && (is_a($content, 'XMLNode') || is_a($content, 'xmlnode'))) { - $out .= $content->toString(); + return $content->toString(); } elseif (is_object($content) && method_exists($content, 'toString')) { - $out .= $content->toString(); - } elseif (is_object($content) && method_exists($content, '__toString')) { - $out .= $content->__toString(); + return $content->toString(); + } elseif (is_object($content) && method_exists($content, 'toString')) { + return $content->toString(); + } else { + return $content; } - return $out; + return false; } /** * Serializes a model resultset into XML