Skip to content

Commit 093e7b8

Browse files
committed
Updated entry API to allow more HTML
1 parent d47237f commit 093e7b8

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

components/com_easyblog/helpers/simpleschema.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public function mapPost($row, $strip_tags='', $text_length=0, $skip=array()) {
6868
$item->postid = $blog->id;
6969
$item->title = $blog->title;
7070
$item->text = $blog->text;
71+
$item->textplain = $this->sanitize($item->textplain);
7172

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

8788
return $item;
8889
}
90+
91+
public function sanitize($text) {
92+
$text = htmlspecialchars_decode($text);
93+
$text = str_ireplace(' ', ' ', $text);
94+
95+
return $text;
96+
}
8997

9098
}

components/com_easyblog/views/entry/view.schema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function display( $tmpl = null )
4242
}
4343

4444

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

4747
echo $callback ? $callback . '(' . json_encode($item) . ')' : json_encode($item);
4848
jexit();

0 commit comments

Comments
 (0)