diff --git a/formats/AtomFormat.php b/formats/AtomFormat.php index 06ef8eb..7ec7d50 100644 --- a/formats/AtomFormat.php +++ b/formats/AtomFormat.php @@ -23,11 +23,11 @@ class AtomFormat extends FormatAbstract{ $entries = ''; foreach($this->getDatas() as $data){ - $entryAuthor = is_null($data->author) ? '' : $this->xml_encode($data->author); - $entryTitle = is_null($data->title) ? '' : $this->xml_encode($data->title); - $entryUri = is_null($data->uri) ? '' : $this->xml_encode($data->uri); - $entryTimestamp = is_null($data->timestamp) ? '' : $this->xml_encode(date(DATE_ATOM, $data->timestamp)); - $entryContent = is_null($data->content) ? '' : $this->xml_encode($this->sanitizeHtml($data->content)); + $entryAuthor = is_null($data['author']) ? '' : $this->xml_encode($data['author']); + $entryTitle = is_null($data['title']) ? '' : $this->xml_encode($data['title']); + $entryUri = is_null($data['uri']) ? '' : $this->xml_encode($data['uri']); + $entryTimestamp = is_null($data['timestamp']) ? '' : $this->xml_encode(date(DATE_ATOM, $data['timestamp'])); + $entryContent = is_null($data['content']) ? '' : $this->xml_encode($this->sanitizeHtml($data['content'])); $entries .= << diff --git a/formats/HtmlFormat.php b/formats/HtmlFormat.php index 19b7702..211a137 100644 --- a/formats/HtmlFormat.php +++ b/formats/HtmlFormat.php @@ -17,11 +17,11 @@ class HtmlFormat extends FormatAbstract{ $entries = ''; foreach($this->getDatas() as $data){ - $entryAuthor = is_null($data->author) ? '' : '

by: ' . $data->author . '

'; - $entryTitle = is_null($data->title) ? '' : $this->sanitizeHtml(strip_tags($data->title)); - $entryUri = is_null($data->uri) ? $uri : $data->uri; - $entryTimestamp = is_null($data->timestamp) ? '' : ''; - $entryContent = is_null($data->content) ? '' : '
' . $this->sanitizeHtml($data->content). '
'; + $entryAuthor = isset($data['author']) ? '

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

' : ''; + $entryTitle = isset($data['title']) ? $this->sanitizeHtml(strip_tags($data['title'])) : ''; + $entryUri = isset($data['uri']) ? $data['uri'] : $uri; + $entryTimestamp = isset($data['timestamp']) ? '' : ''; + $entryContent = isset($data['content']) ? '
' . $this->sanitizeHtml($data['content']). '
' : ''; $entries .= << diff --git a/formats/MrssFormat.php b/formats/MrssFormat.php index 46012e9..7d939f3 100644 --- a/formats/MrssFormat.php +++ b/formats/MrssFormat.php @@ -21,11 +21,11 @@ class MrssFormat extends FormatAbstract{ $items = ''; foreach($this->getDatas() as $data){ - $itemAuthor = is_null($data->author) ? '' : $this->xml_encode($data->author); - $itemTitle = strip_tags(is_null($data->title) ? '' : $this->xml_encode($data->title)); - $itemUri = is_null($data->uri) ? '' : $this->xml_encode($data->uri); - $itemTimestamp = is_null($data->timestamp) ? '' : $this->xml_encode(date(DATE_RFC2822, $data->timestamp)); - $itemContent = is_null($data->content) ? '' : $this->xml_encode($this->sanitizeHtml($data->content)); + $itemAuthor = is_null($data['author']) ? '' : $this->xml_encode($data['author']); + $itemTitle = strip_tags(is_null($data['title']) ? '' : $this->xml_encode($data['title'])); + $itemUri = is_null($data['uri']) ? '' : $this->xml_encode($data['uri']); + $itemTimestamp = is_null($data['timestamp']) ? '' : $this->xml_encode(date(DATE_RFC2822, $data['timestamp'])); + $itemContent = is_null($data['content']) ? '' : $this->xml_encode($this->sanitizeHtml($data['content'])); $items .= <<