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
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 15:45 Go to next message
gladiator is currently offline  gladiator   China
Messages: 61
Registered: June 2002
Location: Beijing
Karma: 0
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


Re: about multi-byte support of alias [message #16975 is a reply to message #16952] Sun, 07 March 2004 01:12 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Fixed in CVS.

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
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: Sat Nov 23 09:49:42 GMT 2024

Total time taken to generate the page: 0.02442 seconds