updated rss helper, fixes #3226

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5765 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2007-10-16 00:44:37 +00:00
parent a921492b5a
commit 1ff8feb94c

View file

@ -179,8 +179,12 @@ class RssHelper extends XmlHelper {
*/
function item($att = array(), $elements = array()) {
$content = null;
foreach ($elements as $key => $val) {
if (isset($elements['link']) && !isset($elements['guid'])) {
$elements['guid'] = $elements['link'];
}
foreach ($elements as $key => $val) {
$attrib = array();
switch ($key) {
case 'pubDate' :
@ -225,10 +229,6 @@ class RssHelper extends XmlHelper {
$elements[$key] = $this->elem($key, $attrib, $val);
}
if (isset($elements['link']) && !isset($elements['guid'])) {
$elements['guid'] = $elements['link'];
}
if (!empty($elements)) {
$content = join('', $elements);
}