[wp-hackers] Unicode url rewriting using add_rewrite_rule()

Deepak Mittal dpac.mittal2 at gmail.com
Thu Dec 13 13:26:25 UTC 2012


Non-percent-encoded URL is being passed in the second preg_match, and
there's an OR operator, so either preg_match can make the condition true.
That is what I meant.


On Thu, Dec 13, 2012 at 2:40 AM, Otto <otto at ottodestruct.com> wrote:

> On Wed, Dec 12, 2012 at 1:55 PM, Deepak Mittal <dpac.mittal2 at gmail.com>
> wrote:
> > We are using urldecode() before matching in class-wp.php, so its not
> > percent encoded.
>
> Umm, doesn't appear to be the case, because the code in class-wp.php
> actually tries it both ways.
>
> Line 204-205:
>
> if ( preg_match("#^$match#", $request_match, $matches) ||
>         preg_match("#^$match#", urldecode($request_match), $matches) ) {
>
>
> -Otto
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
Regards,
Deepak Mittal,
Twitter - @dpacmittal


More information about the wp-hackers mailing list