Menu Content

Support

> Forums, FAQs & Paid Support
Welcome, Guest
Username Password: Remember me

Bug in joomsef.php (plus fix)
(1 viewing) (1) Guest
Support forum for users using free edition of JoomSEF 3 (Joomla 1.5 compatible). These forums are mainly for mutual help between users.

Please note that due to our capacity limitations, we do not monitor these forums regularly.
  • Page:
  • 1
  • 2

TOPIC: Bug in joomsef.php (plus fix)

Bug in joomsef.php (plus fix) 14 years, 4 months ago #14155

Hi,

I'm one of the developers of MageBridge, and with our extension we integrate Magento into Joomla!. This requires some weird tricks to also merge the Magento SEF URLs into the Joomla! SEF URLs, and because of this we have done some customization of the MageBridge router.php file. This works smoothly under Joomla! SEF and theoretically under any other SEF solutions that remains compatible with Joomla! SEF.

This was also always implied with ARTIO JoomSEF. By modifying ARTIO JoomSEF to use the original "router.php" file for MageBridge (setting it to either "Component's Router" or "") this worked out fine. Until one of the latest ARTIO JoomSEF upgrade.

I found a small bug that has heavy consequences for us. In the file "components/com_sef/joomsef.php" there is simple check whether a SEF URL matches the SEF URL as it would have been generated, and if it does not match, it redirects. However, instead of making a simple comparison, the value of $jSef is modified and therefor the comparison does not work:
if ((strpos($jSef, 'index.php?') === false) && ($oldUrl != $jSef)) {


Before this line of code $jSef could contain a valid URL:
/shop/test


But after this line, $jSef is suddenly turned into some kind of half-breed URL:
/shop/test?Itemid=57&option=com_magebridge&request=test&view=root


However, by modifying the line of code to the following, the problem is solved and the comparison works as it was supposed to:
if ((strpos($jSef, 'index.php?') === false) && (!$oldUrl == $jSef)) {


I consider myself good in PHP, but actually this problem baffles me. It must have something to do with PHP5 and references, but I have not it tracked down.

Hopefully you can apply a bugfix with the information above.

Thanks,
Jisse Reitsma
Yireo

Re:Bug in joomsef.php (plus fix) 14 years, 4 months ago #14189

  • dajo
  • OFFLINE
  • Posts: 5069
Hello,

This really is a strange behaviour. Thank you for your report, if you don't mind we'll apply your fix for now and try to investigate this further. It would be very helpful if you could send me your router.php file to This e-mail address is being protected from spambots. You need JavaScript enabled to view it . Thank you.

Best regards,
ARTIO Support Team
ARTIO Support Team

Re:Bug in joomsef.php (plus fix) 14 years, 4 months ago #14196

Hi,

I just ran a quick check on another extension of ours - SimpleLists (www.yireo.com/software/simplelists, is available for free) and the same things: If "Default Joomla! Router" is used, visiting the SimpleLists frontend results in an endless loop - until the fix of this thread is applied.

When "JoomSEF Basic Rewriting" is used there is no problem whatsoever. With SimpleLists that's fine, but unfortunately our MageBridge extension requires to many tricks for this to be functional.

Thanks for the effort.

Re:Bug in joomsef.php (plus fix) 14 years, 4 months ago #14214

  • dajo
  • OFFLINE
  • Posts: 5069
Hi,

I've just tested your SimpleLists component and it works fine for me with the Default Joomla! Router option, so there is probably some problem specific to your PHP version.
I've also tested your suggested fix more thoroughly and it stops the redirection from working completely, since the exclamation mark first converts the $oldUrl string to boolean, and then compares it with $jSef which should be also string, so unless one of the strings is empty the condition is always false.

There will be an option in JoomSEF's configuration to disable this redirection if it causes problems in next version.

It would be great if you could describe the steps needed to reproduce this bug when Joomla! is installed from scratch along with the versions of Apache, PHP and Joomla! used.
Thank you.

Best regards,
ARTIO Support Team
ARTIO Support Team

Re:Bug in joomsef.php (plus fix) 14 years, 3 months ago #14935

when will next version be out?

Re: Bug in joomsef.php (plus fix) 14 years ago #19126

Hello,

Please when will the next version be out or is there an function in Joomsef right now? Working with PHP 5.3 is a requirement for the software operation (Magebridge).

Woodshape.nl
Tim Sombroek
  • Page:
  • 1
  • 2
User Login Empty