Fix encoding issue when Apache feels talkative

This commit is contained in:
Arthur 2013-03-30 19:00:26 +01:00
parent 9b92b2803b
commit 02baecb1c8

View file

@ -40,9 +40,9 @@ END;
$atomlink->addAttribute("rel","self"); $atomlink->addAttribute("rel","self");
$atomlink->addAttribute("type","application/rss+xml"); $atomlink->addAttribute("type","application/rss+xml");
$this->xml->channel->addChild("title",$title); $this->xml->channel->title = $title;
$this->xml->channel->addChild("link",$link); $this->xml->channel->link = $link;
$this->xml->channel->addChild("description",$description); $this->xml->channel->description = $description;
} }
/** /**
@ -60,9 +60,9 @@ END;
*/ */
public function setImage($url, $title, $link) { public function setImage($url, $title, $link) {
$image = $this->xml->channel->addChild("image"); $image = $this->xml->channel->addChild("image");
$image->addChild("url",$url); $image->url = $url;
$image->addChild("title",$title); $image->title = $title;
$image->addChild("link",$link); $image->link = $link;
} }
/** /**
* Add a item to the RSS feed * Add a item to the RSS feed
@ -75,12 +75,15 @@ END;
*/ */
public function addItem($title, $link, $description, $author, $guid, $timestamp) { public function addItem($title, $link, $description, $author, $guid, $timestamp) {
$item = $this->xml->channel->addChild("item"); $item = $this->xml->channel->addChild("item");
$item->addChild("title",$title); $item->title = $title;
$item->addChild("description",$description); $item->description = $description;
$item->addChild("link",$link); $item->link = $link;
$item->addChild("guid",$guid); $item->guid = $guid;
$item->addChild("author",$author); if( isset($guid['isPermaLink']))
$item->addChild("pubDate",date(DATE_RSS,intval($timestamp))); $item->guid['isPermaLink'] = $guid['isPermaLink'];
if( !empty( $author) )
$item->author = $author;
$item->pubDate = date(DATE_RSS,intval($timestamp));
} }
/** /**
* Displays the RSS feed * Displays the RSS feed