Skip to content

Commit

Permalink
Updated entry API to allow more HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
coolbung committed Jul 30, 2014
1 parent d47237f commit 093e7b8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions components/com_easyblog/helpers/simpleschema.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public function mapPost($row, $strip_tags='', $text_length=0, $skip=array()) {
$item->postid = $blog->id;
$item->title = $blog->title;
$item->text = $blog->text;
$item->textplain = $this->sanitize($item->textplain);

$item->image = $blog->getImage();
$item->image->url = $image_data->url;
Expand All @@ -86,5 +87,12 @@ public function mapPost($row, $strip_tags='', $text_length=0, $skip=array()) {

return $item;
}

public function sanitize($text) {
$text = htmlspecialchars_decode($text);
$text = str_ireplace(' ', ' ', $text);

return $text;
}

}
2 changes: 1 addition & 1 deletion components/com_easyblog/views/entry/view.schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function display( $tmpl = null )
}


$item = EasyBlogHelper::getHelper( 'SimpleSchema' )->mapPost($blog, '<p><br><pre><a><blockquote><strong><h2><h3><em>');
$item = EasyBlogHelper::getHelper( 'SimpleSchema' )->mapPost($blog, '<p><br><pre><a><blockquote><strong><h2><h3><em><ul><ol><li>');

echo $callback ? $callback . '(' . json_encode($item) . ')' : json_encode($item);
jexit();
Expand Down

0 comments on commit 093e7b8

Please sign in to comment.