Gossamer Forum
Home : Products : Gossamer Links : Discussions :

[FIX] Eliminating the %2F codes from URL, and using the / sign unencoded

Quote Reply
[FIX] Eliminating the %2F codes from URL, and using the / sign unencoded
If you also hate the encoded / signs in the URL, which will result ugly URL in your browser, then you can ignore it with this modification.

Add the line highlighted with red to the sub escape in admin/GT/CGI.pm .

Original code (LSQL v2.1.1):
Code:
sub escape {
#--------------------------------------------------------------------------------
# return the url encoded string of the passed argument
#
my $toencode = pop;
return unless defined $toencode;
$toencode =~ s/([^\w.-])/sprintf("%%%02X",ord($1))/eg;
return $toencode;
}

Modified code (added code highlighted with red)
Code:
sub escape {
#--------------------------------------------------------------------------------
# return the url encoded string of the passed argument
#
my $toencode = pop;
return unless defined $toencode;
$toencode =~ s/([^\w.-])/sprintf("%%%02X",ord($1))/eg;
$toencode =~ s/\%2F/\//g; # decodes back the %2F back to /
return $toencode;
}
For the v2.1.0 version the modification is similar, but you should only insert the red line, because there was some other changes, in the v2.1.1 version upgrade.

There is not known any disagvantage of the change. I'm using this way on my own website since more than 1 year, and there was not problems with that.
If somebody knows or finds any disadvantage of it, let me know.

Have a nice day! Cool

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Subject Author Views Date
Thread [FIX] Eliminating the %2F codes from URL, and using the / sign unencoded webmaster33 2141 Jun 28, 2002, 2:36 AM
Thread Re: [webmaster33] [FIX] Eliminating the %2F codes from URL, and using the / sign unencoded
Paul 2086 Jun 28, 2002, 2:46 AM
Thread Re: [Paul] [FIX] Eliminating the %2F codes from URL, and using the / sign unencoded
webmaster33 2068 Jun 28, 2002, 3:20 AM
Thread Re: [webmaster33] [FIX] Eliminating the %2F codes from URL, and using the / sign unencoded
Paul 2060 Jun 28, 2002, 6:16 AM
Thread Re: [Paul] [FIX] Eliminating the %2F codes from URL, and using the / sign unencoded
pugdog 2050 Jun 28, 2002, 9:15 AM
Post Re: [pugdog] [FIX] Eliminating the %2F codes from URL, and using the / sign unencoded
webmaster33 2041 Jun 28, 2002, 10:24 AM