WordPress.org

Ready to get started?Download WordPress

Forums

"preg_match" can not match Chinese correctly (1 post)

  1. bossma
    Member
    Posted 3 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic