WestwegoMan.com

Computers, Websites & Forums => SMF Forum tips & tricks => Topic started by: WestwegoMan on Jan 23, 2015, 5:10 PM

Title: Add more characters to those not allowed in usernames
Post by: WestwegoMan on Jan 23, 2015, 5:10 PM
Add more characters to those not allowed in usernames.

This exact edit will make it where only numbers and letters and spaces are allowed.

in ./Sources/Subs-Members.php

Find:
Code: [Select]
// 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');

Replace with:
Code: [Select]
// Only these characters are permitted.
if (preg_match('~^[a-zA-Z0-9 ]{1,}$~', $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');
SimplePortal 2.3.6 © 2008-2014, SimplePortal