Exemple #1
0
 /**
  * Get the content of the post.
  *
  * @param object $content to link to.
  * @return string with url to display content.
  */
 public function GetPost($slug = null)
 {
     $posts = parent::GetContent('post', $slug);
     foreach ($posts as $p) {
         // Sanitizing
         $p->title = htmlentities($p->title, null, 'UTF-8');
         $p->data = $this->filter->doFilter(htmlentities($p->data, null, 'UTF-8'), $p->filter);
     }
     return $posts;
 }
Exemple #2
0
 /**
  * Get the content of the page.
  *
  * @param object $content to link to.
  * @return string with url to display content.
  */
 public function GetPage($url = null)
 {
     $url = is_null($url) ? $this->defaultUrl : $url;
     $res = parent::GetContent('page', $url);
     isset($res[0]) or die('No page to view.');
     $content = (array) $res[0];
     // Sanitizing
     $content['title'] = htmlentities($content['title'], null, 'UTF-8');
     $content['data'] = $this->filter->doFilter(htmlentities($content['data'], null, 'UTF-8'), $content['filter']);
     return $content;
 }