9hills
V2EX  ›  问与答

有谁知道为啥Discuz不能注册含“欣”的用户名么。

  •  
  •   9hills · Apr 14, 2011 · 5531 views
    This topic created in 5532 days ago, the information mentioned may be changed or developed.
    最近管理一个实名制的内部论坛。。。说不能注册含“欣”的的用户名。

    去uc_client/model/user.php下面一看。。。在uc_server目录下同文件也有:

    function check_username($username) {
    $guestexp = '\xA1\xA1|\xAC\xA3|^Guest|^\xD3\xCE\xBF\xCD|\xB9\x43\xAB\xC8';
    $len = strlen($username);
    if($len > 15 || $len < 3 || preg_match("/\s+|^c:\\con\\con|[%,\*\"\s\<\>\&]|$guestexp/is", $username)) {
    return FALSE;
    } else {
    return TRUE;
    }
    }


    这个有典故么。。很不能理解
    1 replies    1970-01-01 08:00:00 +08:00
    that5
        1
    that5  
       Apr 14, 2011
    @9hills
    好像是utf8版的bug,好像以前听说过,修改过滤规则就对了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1006 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 23:22 · PVG 07:22 · LAX 16:22 · JFK 19:22
    ♥ Do have faith in what you're doing.