"preg_match" can not match Chinese correctly
-
I tried to use Permalinks with WordPress running on an IIS server.
Use “wordpress-url-rewrite” for permalink.
But if i use a chinese tag,it will be get a 404 error.
So i must convert encoding GBK to utf-8,The majority cinese tag can visit,but some can not visit still.Through track code,i find the problem in:
wp-include/query.php
function &get_posts()
if ( preg_match(‘/[+\s]+/’, $q[‘tag’]) || !empty($q[‘cat’]) )preg_match can not match Chinese correctly.
Then i try to fix this problem:
urlencode($q[‘tag’])
or
preg_match(‘/\+/’, $q[‘tag’])
or
mb_eregi(‘/[+\s]+/’, $q[‘tag’])In linux and apache,this problem does not exist.
This is a bug?
- The topic ‘"preg_match" can not match Chinese correctly’ is closed to new replies.