From 093e7b816f46cdb8bbfe384bb27e15c67fc04715 Mon Sep 17 00:00:00 2001 From: Ashwin Date Date: Wed, 30 Jul 2014 18:36:25 +0530 Subject: [PATCH] Updated entry API to allow more HTML --- components/com_easyblog/helpers/simpleschema.php | 8 ++++++++ components/com_easyblog/views/entry/view.schema.php | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/components/com_easyblog/helpers/simpleschema.php b/components/com_easyblog/helpers/simpleschema.php index 70ab1bb..0f8ce73 100644 --- a/components/com_easyblog/helpers/simpleschema.php +++ b/components/com_easyblog/helpers/simpleschema.php @@ -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; @@ -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; + } } diff --git a/components/com_easyblog/views/entry/view.schema.php b/components/com_easyblog/views/entry/view.schema.php index edffa29..f896607 100644 --- a/components/com_easyblog/views/entry/view.schema.php +++ b/components/com_easyblog/views/entry/view.schema.php @@ -42,7 +42,7 @@ function display( $tmpl = null ) } - $item = EasyBlogHelper::getHelper( 'SimpleSchema' )->mapPost($blog, '


'); + $item = EasyBlogHelper::getHelper( 'SimpleSchema' )->mapPost($blog, '


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