mod_smf_RecentTopics has ampersand issues in URLs

Started by krick, December 25, 2008, 03:43:40 AM

Previous topic - Next topic

krick

Mambo 4.6.5
SMF 1.1.7

When I use the Recent topics mod, my site won't validate cleanly due to ampersand problems.  I've done some hacking on the source, and I've come up with a change to line 31 that seems to work, but I'm not positive that it is the correct solution...


Before:


$myurl = $_SERVER['PHP_SELF'] . "?option=com_smf&Itemid=" . $row[0]."&";




After:


$myurl = $_SERVER['PHP_SELF'] . "?option=com_smf&Itemid=" . $row[0];



Orstio

You'll want to change the last & to an & as well instead of deleting it.

krick

Are you sure?

I was getting double ampersands in my URLs, so I deleted it.

Maybe it's specific to the settings I was using within the mod.


krick

Quote from: Orstio on December 25, 2008, 01:34:36 PM
Can I see the URL?

I've reverted the recent topics module code to the original so you can see the topic URLs on my front page...

http://www.tankadin.com/

They still work when you click on them, but they've got double ampersands in them and the page won't validate clean...

http://validator.w3.org/check?uri=http%3A%2F%2Fwww.tankadin.com

Orstio

OK, after looking at the code in the module, I can see where the problem lies.

You can get rid of the last ampersand, but lower down you will see some instances of $scripturl followed by a question mark.  You'll want to change those to ampersands (& amp;) as well.

krick

I've made the corrections and attached the updated zip file

Omega X

I've been looking for something like this. A nice stop gap solution for me atleast.

Now if only there was a way to SEF up this.

Advertisement: