By Tony on Friday, 23 December 2016
Posted in Technical Issues
Replies 6
Likes 0
Views 515
Votes 0
Hello,

We have just imported an RSS Feed into Easyblog and it worked fairly well. However, the feed contains encoded html to stop braking the rendering of the feed. Now when the posts are imported into Easyblog this is just treated as text and is not decoded on the frontend.

Do you have a solution for decoding on import?

Many thanks
Tony
I figured it out:

Change:

$contents = @ $item->get_content();


to

$contents = @ html_entity_decode($item->get_content());


In file:
administrator/components/com_easyblog/includes/feeds/feeds.php

around line 171 of this file.

@stackideas can you make this change to the next release since it's a logical change?

Many thanks
·
Friday, 23 December 2016 18:39
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Stephen,

Hm, I am not too sure why do you need to palce the html_entity_decode because you are actually altering the "original state" of the contents. Contents should be stored as encoded html entities to avoid people messing with the DOM.
·
Friday, 23 December 2016 18:56
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

We are yes because Easyblog stores it as raw html i.e. decoded in the database. Unless of course you add the decode to the output of blog posts but in my scenario this is much more work to override every easyblog view with a decode. I am only doing a single import to migrate blog posts from an existing url.

Many thanks
·
Friday, 23 December 2016 19:03
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Stephen,

That is actually not ideal because if your RSS picks up script tags, it could be exploit-able. This is why the contents are always decoded.
·
Saturday, 24 December 2016 02:44
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

In which case Easyblog should be decoding HTML output if it is encoded. But it doesn't and thus you need to allow HTML to be inserted otherwise the RSS Feed import with any html is just plain useless as you don't strip it or run any HTML filters through it.

You should be able to import it as normal html running through the standard Joomla! Editor filter which thus makes it safe.
·
Thursday, 12 January 2017 05:44
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Stephen,

It seems like feeds that contains CDATA may contain html codes (un-encoded) and feeds that doesn't contain CDATA are probably encoding the contents to html entities.

I guess we could try adding this in the next release and see how this goes.
·
Thursday, 12 January 2017 11:55
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post