[pmwiki-users] url escape sequence puzzle

Henrik henrik.bechmann at sympatico.ca
Sat Apr 28 09:55:41 CDT 2007


To answer my own question (in case anyone is interested):

the address=mail at address.com parameter value was getting escaped twice 
into mail%2540 (instead of the correct mail%40) as the result of an 
Apache .htaccess RewriteEngine operation (that I had created for other 
reasons):

I had

RewriteRule ^(.*/wiki.php)(/)(.*)$ http://%{HTTP_HOST}/$1?n=$3 [QSA,R,L]

But needed

RewriteRule ^(.*/wiki.php)(/)(.*)$ http://%{HTTP_HOST}/$1?n=$3 [QSA,R,NE,L]

Note the additional "NE" (no escape) flag, to prevent the re-written 
query string from being escaped before redirection.

Where the parameter was working prior to this, the query string portion 
of the url was not being rewritten, therefore not being escaped again.

- Henrik

Henrik wrote:
> I have a wiki farm, some of which offer email list subscriptions to 
> users with this wiki code:
>
> ===========================
>
> To subscribe to our email list, enter your email address below:
>
> (:input form "{$ScriptUrl}/TCGN.SubscribeResults" GET:)
>
> Enter your email address:\\
> (:input text address size=40:)
>
> (:input submit value="Subscribe":)
> (:input end:)
>
> ===========================
>
> In most, from input of "henrik at bechmann.ca", the form (for the action) 
> generates something like
>
> http://tcgn.ca/wiki/wiki.php?n=TCGN.SubscribeResults&address=henrik%40bechmann.ca
>
> which is correct, but on one site, the following is generated:
>
> http://tcgn.ca/wiki/wiki.php?n=TCGN.SubscribeResults&address=henrik%2540bechmann.ca
>
> Note the %25 in front of the "40". So the percent of the url sequence is 
> itself being escaped.
>
> I'm quite baffled about where to look for this bug.
>
> Anyone have any ideas?
>
> Thanks,
>
> - Henrik
>
>   

-- 

Henrik Bechmann
www.bechmann.ca
Webmaster, www.dufferinpark.ca




More information about the pmwiki-users mailing list