mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 16:56:44 +02:00
Cleaned usernames contain only single spaces, so 'a_name' and 'a__name' are treated as the same name [Bug #15634]
git-svn-id: file:///svn/phpbb/trunk@8261 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -571,7 +571,7 @@ else
|
||||
|
||||
// Checks/Operations that have to be completed prior to starting the update itself
|
||||
$exit = false;
|
||||
if (version_compare($current_version, '3.0.RC4', '<='))
|
||||
if (version_compare($current_version, '3.0.RC8', '<='))
|
||||
{
|
||||
// Define missing language entries...
|
||||
if (!isset($lang['CLEANING_USERNAMES']))
|
||||
@@ -715,9 +715,13 @@ if (version_compare($current_version, '3.0.RC4', '<='))
|
||||
// duplicates might be created. Since the column has to be unique such usernames
|
||||
// must not exist. We need identify them and let the admin decide what to do
|
||||
// about them.
|
||||
// After RC8 this was changed again, but this time only usernames containing spaces
|
||||
// are affected.
|
||||
$sql_where = (version_compare($current_version, '3.0.RC4', '<=')) ? '' : "WHERE username_clean LIKE '% %'";
|
||||
$sql = 'SELECT user_id, username, username_clean
|
||||
FROM ' . USERS_TABLE . '
|
||||
ORDER BY user_id ASC';
|
||||
FROM ' . USERS_TABLE . "
|
||||
$sql_where
|
||||
ORDER BY user_id ASC";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$colliding_users = $found_names = array();
|
||||
@@ -2765,6 +2769,8 @@ function utf8_new_clean_string($text)
|
||||
// Other control characters
|
||||
$text = preg_replace('#(?:[\x00-\x1F\x7F]+|(?:\xC2[\x80-\x9F])+)#', '', $text);
|
||||
|
||||
$text = preg_replace('# {2,}#', ' ', $text);
|
||||
|
||||
// we can use trim here as all the other space characters should have been turned
|
||||
// into normal ASCII spaces by now
|
||||
return trim($text);
|
||||
|
Reference in New Issue
Block a user