Author Topic: AJAX Scroller - conflicts with other RSS modules that use simplepie library  (Read 1979 times)

mblodau

  • Newbie
  • *
  • Posts: 1
    • View Profile
Hi there,

i noticed a conflict between Ajax Scroller and other RSS extensions that use the simplepie library.

In this case i tried to use the "Slick RSS" module. When both modules are activated i get a fatal error on the page:

 
Quote
"Fatal error: Cannot redeclare class SimplePie_Cache_MySQL in /home/tu/public_html/libraries/simplepie/simplepie.php on line 9069"


Website is: http://www.tu.se

Did some research on that error and figured out that the reason is that both modules try to include the simplepie.php library.

The solution is to check if the SimplePie class already exists before running an include.

I checked the source code of mod_slick_rss and saw that they have a security check around their simplepie.php include.

Since Ajaxscroller is Ioncube encoded i can't see if you just include the simplepie class or also have a security check around it.

Because of the encrypted code i have to assume that the Ajaxscroller causes the problem because you include the simplepie.php without first doing a check if that class already exists.

Could you please reply and confirm or deny this assumption?

The include in the Ajaxscroller should look like this in order to be compatible with other Joomla extensions that use RSS.

Code: [Select]
if(!class_exists('SimplePie')){
     //include Simple Pie processor class
     require_once (JPATH_SITE.DS.'libraries'.DS.'simplepie'.DS.'simplepie.php');
}

Best regards,

Martin Blodau
Pixpro Stockholm

Saka

  • Administrator
  • Hero Member
  • *****
  • Posts: 2,453
    • View Profile
    • Sakic.Net
I don't have access to the code right now but I will check shortly and let you know.

Saka

  • Administrator
  • Hero Member
  • *****
  • Posts: 2,453
    • View Profile
    • Sakic.Net
Hello again.

My module is using Joomla's own API for including this class:
Code: [Select]
jimport ('simplepie.simplepie');This function is already taking care about double inclusion etc.

So you should just replace this code
Code: [Select]
if(!class_exists('SimplePie')){
     //include Simple Pie processor class
     require_once (JPATH_SITE.DS.'libraries'.DS.'simplepie'.DS.'simplepie.php');
}
with
Code: [Select]
jimport ('simplepie.simplepie');in the module in question and it should work fine.

Seems like the issue has been already discussed here: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=16906