FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Suggestions » about multi-byte support of alias
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
about multi-byte support of alias [message #16952] Sat, 06 March 2004 15:45 Go to previous message
gladiator is currently offline  gladiator   China
Messages: 61
Registered: June 2002
Location: Beijing
Karma:
Member
Since there are some code in register.php.t to sanitize alias as well as login, users could not use multi-byte characters in their alias.

To solve this, I make another function named 'sanitize_alias'(a copy from sanitize_login of coz):
function sanitize_login($alias)
{
	for ($i = 0; $i < 32; $i++) $list[] = chr($i);

	return str_replace($list, array_fill(0, count($list), ''), $alias);
}


then change the Alias Check code from
		if (($_POST['reg_alias'] = trim(sanitize_login($_POST['reg_alias'])))) {
			if (is_login_blocked($_POST['reg_alias'])) {
				set_err('reg_alias', '{TEMPLATE: register_err_alias_notallowed}');
			}
			if (strlen($_POST['reg_alias']) > $GLOBALS['MAX_LOGIN_SHOW']) {

to
		if (($_POST['reg_alias'] = trim(sanitize_alias($_POST['reg_alias'])))) {
			if (strlen($_POST['reg_alias']) > $GLOBALS['MAX_LOGIN_SHOW']) {


A quick and dirty hack. Embarassed

Could this problem be solved in the next release? Smile


[Message index]
 
Read Message
Read Message
Previous Topic: date on last msg line
Next Topic: Relative font sizes for FUDcode
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 08 14:31:09 GMT 2024

Total time taken to generate the page: 0.04747 seconds