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

Deepak Mittal dpac.mittal2 at gmail.com
Thu Dec 13 13:29:04 UTC 2012


Sorry, one more thing. If you change the code to :

if ( preg_match("#^$match#", $request_match, $matches) ||
        preg_match("#^$match#u", urldecode($request_match), $matches) ) {

unicode URLs start working (notice the 'u' modifier).


On Thu, Dec 13, 2012 at 6:56 PM, Deepak Mittal <dpac.mittal2 at gmail.com>wrote:

> 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
>



-- 
Regards,
Deepak Mittal,
Twitter - @dpacmittal


More information about the wp-hackers mailing list