Jump to content
Electronics-Lab.com Community

Odd, very odd...

Guest liquibyte

Recommended Posts

Guest liquibyte

You mean the high number of guest visitors?

No, audioguru's on there twice.  I checked the profile page for both usernames and it was him twice and not a spoof or anything.
Link to comment
Share on other sites

Guest liquibyte

I finished the code you wanted me to do.  Here's what you need to change in order to deny usernames with odd characters.

In /Sources/Subs-Members.php find these lines (around line 500)...

	// No name?!  How can you register with no name?
	if (empty($regOptions['username']))
		$reg_errors[] = array('lang', 'need_username');

...and add this just after it.

	// Check if it's only a..z, A..Z, 0..9
	if ( preg_match("/[^-a-z-A-Z0-9_ .]/i", $regOptions['username']) )
	  $reg_errors[] = array('lang', 'bad_username');

and then for the error message, in /Themes/default/languages/Login.english.php in the section "// Registration form." add this line.

$txt['bad_username'] = 'Usernames can only contain alphanumeric characters and dashes or underscores';

Now RTL languages and extended UTF8 characters can't be used to sign up accounts.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...