Bug with SEF URLs? (possible PHP's parse_url bug in uri.php)

Discuss Search Engine Optimization in relation to Joomla!. This forum will also have discussions on SEF/SEO Joomla! extensions.

Moderator: General Support Moderators

Locked
User avatar
Valandis
Joomla! Intern
Joomla! Intern
Posts: 89
Joined: Wed Mar 18, 2009 10:18 pm
Location: Munich, Germany
Contact:

Bug with SEF URLs? (possible PHP's parse_url bug in uri.php)

Post by Valandis » Fri Jul 09, 2010 10:31 am

Hi there. I recently installed K2 on a local XAMPP 2.7.3 test environment system (Joomla 1.5.18) and turned on Joomla's SEO/SEF.

The bug: when I used any K2 tags that included the Greek letter "ρ" (RHO), then Joomla generated some undefined character and the URL to that tag returned an empty page! After reporting this bug at the K2 forum of JoomlaWorks (http://community.getk2.org/forum/topics ... ms-are-not), someone noticed a possible issue with the construction of JURI object in the file /libraries/joomla/environment/uri.php at line 772. The parse_url function for some reason converts the greek character "ρ" to an unspecified character!

Any feedback would be appreciated.
Joomla development, extensions and tutorials: http://www.valandis.de
Joomla extensions at JED: http://extensions.joomla.org/extensions/owner/Valandis
Follow me on Twitter: @ValWebDesign

User avatar
Valandis
Joomla! Intern
Joomla! Intern
Posts: 89
Joined: Wed Mar 18, 2009 10:18 pm
Location: Munich, Germany
Contact:

Re: Bug with SEF URLs? (possible PHP's parse_url bug in uri.

Post by Valandis » Sat Jul 10, 2010 7:31 am

Has anyone from Joomla's devs tried to reproduce this, or have some idea what the problem could be? Maybe PHP has some bug with the parse_url function? Some feedback would be nice here.
Joomla development, extensions and tutorials: http://www.valandis.de
Joomla extensions at JED: http://extensions.joomla.org/extensions/owner/Valandis
Follow me on Twitter: @ValWebDesign

User avatar
Valandis
Joomla! Intern
Joomla! Intern
Posts: 89
Joined: Wed Mar 18, 2009 10:18 pm
Location: Munich, Germany
Contact:

Re: Bug with SEF URLs? (possible PHP's parse_url bug in uri.

Post by Valandis » Sat Jul 10, 2010 10:04 am

Well it seems that the problem lies within Joomla's file libraries/joomla/environment/uri.php!

I changed the file libraries/joomla/environment/uri.php (Joomla 1.5.18) by commenting out the following lines of code: 744,745,769-773. In this way the function _parseURL parses the URL with the "old" way as if we were using an older version of PHP.. and guess what, the problem with the undefined character is solved! Now all K2 tags (the same problem also with Zoo 2.0) that contain Greek letters (especially the ones with the "ρ" letter) work just fine.

I'm not sure if this fix works with all different versions of PHP (I tested it locally with XAMPP 1.7.3 - PHP 5.3.1 - Joomla 1.5.18), but I'm sure it will help people who had the same problem as I did.

Mods, if it is possible, move this topic at the Joomla bugs category.
Joomla development, extensions and tutorials: http://www.valandis.de
Joomla extensions at JED: http://extensions.joomla.org/extensions/owner/Valandis
Follow me on Twitter: @ValWebDesign

User avatar
Leftfield
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4432
Joined: Fri Dec 08, 2006 3:33 am
Contact:

Re: Bug with SEF URLs? (possible PHP's parse_url bug in uri.

Post by Leftfield » Sun Jul 11, 2010 7:12 pm

Hi Valandis :)

Try with: Unicode slugs SEF
Joomla Templates and Plugins /https://youjoomla.com/

User avatar
Valandis
Joomla! Intern
Joomla! Intern
Posts: 89
Joined: Wed Mar 18, 2009 10:18 pm
Location: Munich, Germany
Contact:

Re: Bug with SEF URLs? (possible PHP's parse_url bug in uri.

Post by Valandis » Mon Jul 12, 2010 8:25 am

Leftfield wrote:Hi Valandis :)

Try with: Unicode slugs SEF
Thanks for the tip mate, I have already tried this before as well as other extensions. The problem is still there until I do the fix I mentioned above in the file "libraries/joomla/environment/uri.php".

The bug is probably a PHP version-related bug (XAMPP 1.7.3 uses PHP 5.3.1), since it is caused by PHP's own function parse_url and it affects extensions like K2 and Zoo 2.0 that use the same technique in parsing the URLs.
Joomla development, extensions and tutorials: http://www.valandis.de
Joomla extensions at JED: http://extensions.joomla.org/extensions/owner/Valandis
Follow me on Twitter: @ValWebDesign


Locked

Return to “Search Engine Optimization (Joomla! SEO) in Joomla! 1.5”