Wednesday, October 27, 2010

Issue with the Simplepie Parser....

Hi friends,

While working with embedded feed which I discussed earlier I found an issue with the simplepie parser. Though the parser seems to be working fine with all the feeds until you want it to work on custom fields urls or with operating systems which can't support automatic decoding of urls. hence I have provided this patch over here which can make it workable on all the platforms.

In parser_simplepie.module which you can find out at contributed third party module directory under feedapi/parser_simplepie, the original_url must be decoded to the normal format.

You can find it in a function _parser_simplepie_feedapi_parse which is there in the same file and search for $curr_item->options->original_url.
 which will look something like this:
$curr_item->options->original_url = ($entity_decode && $simplepie_item->get_link()) ? html_entity_decode($simplepie_item->get_link()) : $simplepie_item->get_link();

Change it to:

$curr_item->options->original_url = ($entity_decode && urldecode($simplepie_item->get_link())) ? urldecode(html_entity_decode($simplepie_item->get_link())) : urldecode($simplepie_item->get_link());

And Thats it. It should work now on any platform...

No comments:

Post a Comment