Discuz "Xin" "Heng" User cannot register bug modification

Source: Internet
Author: User

Discuz "Xin" "Heng" User cannot register

The reason is that Discuz has such a piece of code

functionCheck_username ($username) {                $guestexp= ' \xa1\xa1|\xac\xa3|^guest|^\xd3\xce\xbf\xcd|\xb9\x43\xab\xc8 '; if(Preg_match("/\s+|^c:\\con\\con| [%,\*\ "\s\<\>\&]|$guestexp/is ",$username)) {                        return FALSE; } Else {                        return TRUE; }        }

$guestexp = ' \xa1\xa1|\xac\xa3|^guest|^\xd3\xce\xbf\xcd|\xb9\x43\xab\xc8 ';

Will match, with "Hin", "Heng" username, because

Again Utf-8, "hin" code: \XE6\XAC\XA3, "Heng" code: \XE8\XA1\XA1

Bug Modification:

$guestexp = ' \xa1\xa1|\xac\xa3|^guest|^\xd3\xce\xbf\xcd|\xb9\x43\xab\xc8 ';

Switch

$guestexp = ' (? <!\xe8) \xa1\xa1| (? <!\xe6) \xac\xa3|^guest|^\xd3\xce\xbf\xcd|\xb9\x43\xab\xc8 ';

This can be matched with \XA1\XA1|\XAC\XA3 encoded UTF-8 special characters, and will not match "Hin", "Heng".

Discuz "Xin" "Heng" User cannot register bug modification

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.