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

Home » FUDforum » FUDforum Suggestions » about multi-byte support of alias
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
about multi-byte support of alias [message #16952] Sat, 06 March 2004 10:45 Go to next message
gladiator is currently offline  gladiator   China
Messages: 61
Registered: June 2002
Location: Beijing
Karma: 0
Member
add to buddy list
ignore all messages by this user
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


Re: about multi-byte support of alias [message #16975 is a reply to message #16952] Sat, 06 March 2004 20:12 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
Fixed in CVS.

FUDforum Core Developer
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
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: Sun Dec 17 23:54:16 EST 2017

Total time taken to generate the page: 0.00546 seconds