getExtraInfos(); $title = htmlspecialchars($extraInfos['name']); $uri = htmlspecialchars($extraInfos['uri']); $atomquery = str_replace('format=Html', 'format=Atom', htmlentities($_SERVER['QUERY_STRING'])); $mrssquery = str_replace('format=Html', 'format=Mrss', htmlentities($_SERVER['QUERY_STRING'])); $entries = ''; foreach($this->getItems() as $item) { $entryAuthor = isset($item['author']) ? '

by: ' . $item['author'] . '

' : ''; $entryTitle = isset($item['title']) ? $this->sanitizeHtml(strip_tags($item['title'])) : ''; $entryUri = isset($item['uri']) ? $item['uri'] : $uri; $entryTimestamp = ''; if(isset($item['timestamp'])) { $entryTimestamp = ''; } $entryContent = ''; if(isset($item['content'])) { $entryContent = '
' . $this->sanitizeHtml($item['content']) . '
'; } $entryEnclosures = ''; if(isset($item['enclosures'])) { $entryEnclosures = '

Attachments:

'; foreach($item['enclosures'] as $enclosure) { $url = $this->sanitizeHtml($enclosure); $entryEnclosures .= '
  • ' . substr($url, strrpos($url, '/') + 1) . '
  • '; } $entryEnclosures .= '
    '; } $entryCategories = ''; if(isset($item['categories']) && count($item['categories']) > 0) { $entryCategories = '

    Categories:

    '; foreach($item['categories'] as $category) { $entryCategories .= '
  • ' . $this->sanitizeHtml($category) . '
  • '; } $entryCategories .= '
    '; } $entries .= <<

    {$entryTitle}

    {$entryTimestamp} {$entryAuthor} {$entryContent} {$entryEnclosures} {$entryCategories} EOD; } $charset = $this->getCharset(); /* Data are prepared, now let's begin the "MAGIE !!!" */ $toReturn = << {$title}

    {$title}

    {$entries} EOD; // Remove invalid characters ini_set('mbstring.substitute_character', 'none'); $toReturn = mb_convert_encoding($toReturn, $this->getCharset(), 'UTF-8'); return $toReturn; } public function display() { $this ->setContentType('text/html; charset=' . $this->getCharset()) ->callContentType(); return parent::display(); } }