1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-08 01:44:07 +02:00

Merge branch '3.2.x' into 3.3.x

This commit is contained in:
Marc Alexander 2019-07-27 16:20:58 +02:00
commit 812edebfb7
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995
2 changed files with 10 additions and 7 deletions

View File

@ -855,7 +855,7 @@ class acp_users
$check_ary += array(
'username' => array(
array('string', false, $config['min_name_chars'], $config['max_name_chars']),
array('username', $user_row['username'])
array('username', $user_row['username'], true)
),
);
}

View File

@ -1732,7 +1732,7 @@ function phpbb_validate_timezone($timezone)
* @return mixed Either false if validation succeeded or a string which will be
* used as the error message (with the variable name appended)
*/
function validate_username($username, $allowed_username = false)
function validate_username($username, $allowed_username = false, $allow_all_names = false)
{
global $config, $db, $user, $cache;
@ -1815,13 +1815,16 @@ function validate_username($username, $allowed_username = false)
return 'USERNAME_TAKEN';
}
$bad_usernames = $cache->obtain_disallowed_usernames();
foreach ($bad_usernames as $bad_username)
if (!$allow_all_names)
{
if (preg_match('#^' . $bad_username . '$#', $clean_username))
$bad_usernames = $cache->obtain_disallowed_usernames();
foreach ($bad_usernames as $bad_username)
{
return 'USERNAME_DISALLOWED';
if (preg_match('#^' . $bad_username . '$#', $clean_username))
{
return 'USERNAME_DISALLOWED';
}
}
}