Gossamer Forum
Home : Products : Gossamer Links : Discussions :

XHTML code compliance query

Quote Reply
XHTML code compliance query
Hi,

I've been working on getting my html code XHTML compliant and one of the issues I had was with the & (ampersand) sign that is used in GT scripts to generate code for links in dynamic mode/pages.

Pages are not validated if the use the ampersand character "&" but are if they use the &

So I went hunting for the code that generates the strings that are generated and found this :

Code:
# Build a query string.
...
$original .= $IN->escape($_) . "=" . $IN->escape($in_hash->{$_}) . "&";
...

# Fix up the CGI references.
...
$output .= "&$key=" . $IN->escape($in_hash->{$key});
...

in the Links.pm file

Now I replace it with the below which was a bit complicated since the W3C requirements include both an "&" and a ";" (semicolon). Well first of all it works and produces the correct & in the string but I was wondering whether this was a really bad thing to do. Not that I like doing bad things but I thought it may have some adverse affect that I hadn't thought about.

Code:
# Build a query string.
...
$original .= $IN->escape($_) . "=" . $IN->escape($in_hash->{$_}) . "&|";
...

# Fix up the CGI references.
...
$output .= "&$key=" . $IN->escape($in_hash->{$key});
...

Obviously the good thing is that it gets me closer to validating my code Wink

I also wanted to share this with the forum IF someone who knows more than I do about Perl (which is most of the forum members) can say whether it is not a good idea, a part from the "Don't hack core code" alert.

And BTW I have not got a clue why it needs to be "&|" in the first case and "&$key=" in the second but with this code it validates and having the "|" in the second has the actual "|" sign appear in the URL and the d=1 is repeated twice. It's been a while since I coded my own perl but I remembered using this and it worked but it may not be working as efficiently as it could.

Thanks, John
Significant Media
Quote Reply
Re: [Jag] XHTML code compliance query In reply to
Hi Jag,


does this still work for you or have there appeared any problems?

P.S.: Can't this not be done by a rewrite/replace-url-amps-global?

Regards,
Manu

Shopping Portal Shop-Netz.de® | Partnerprogramme | Flugreisen & Billigflüge | KESTERMEDIA e.K. | European Affiliate Marketing Forum.

Last edited by:

ManuGermany: Apr 4, 2007, 5:21 AM