You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2006/06/08 15:57:12 UTC

DO NOT REPLY [Bug 34602] - mod_rewrite fails to correctly deal with URLS that have escapes in them

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34602>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34602


mike@we11er.co.uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mike@we11er.co.uk




------- Additional Comments From mike@we11er.co.uk  2006-06-08 13:57 -------
Hi there. Just spent an hour or so looking at the mod_rewrite source.
Unfortunately it looks like apache passes the module the path/filename part of
the url as already unescaped.

There is a workaround to reverse the unescaping, but you still can't use '/'
(%2F) because it is already decoded by the time mod_rewrite gets it, and there's
no way to know whether it was escaped or not in the original url.

I hacked together a messy fixurl(...) function to re-encode '=', '&', '#' etc.,
then applied that to the uri variable in function 

int apply_rewrite_rule(...)

Just before

    rc = (ap_regexec(regexp, uri, AP_MAX_REG_MATCH, regmatch, 0) == 0);
    if (! (( rc && !(p->flags & RULEFLAG_NOTMATCH)) ||
           (!rc &&  (p->flags & RULEFLAG_NOTMATCH))   ) ) {
        return 0;
    }

Like I say my code is a hack, so I'll leave it up to someone else to provide a
better fix/patch.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org