News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Disable charcters in name?

Started by swiftymcfeat, July 13, 2010, 10:19:13 PM

Previous topic - Next topic

swiftymcfeat

I have a game engine which grabs names and passwords from my forum database.

The problem is, my game does not support characters that are not simple letters or numbers. So i was wondering if anyone knows how to disable certain characters when registering, or making it so they can only choose letters and numbers.

thanks
James

Kill Em All



My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.

swiftymcfeat

i have a problem though. I want it to be the opposite way around. I want a rule that states what they CAN use.... Because i JUSt wants letters, numbers, and spaces... NOTHING else, no symbols or foreign letters.

Kill Em All

Unfortunately, I'm not aware of any other methods that would achieve that, you would just have to put every symbol.

   // Only these characters are permitted.
   if (preg_match('~[<>`~!#$%^*()_-=+•|.,?':{}@&"\'=\\\\]~', preg_replace('~&#(?:\\d{1,7}|x[0-9a-fA-F]{1,6});~', '', $regOptions['username'])) != 0 || $regOptions['username'] == '_' || $regOptions['username'] == '|' || strpos($regOptions['username'], '[code') !== false || strpos($regOptions['username'], '[/code') !== false)
      $reg_errors[] = array('lang', 'error_invalid_characters_username');


I think that would cover the basics.


My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.

kat

Unless you want to create a big list of censored words...

Advertisement: