diff options
Diffstat (limited to 'phpBB/install')
-rw-r--r-- | phpBB/install/database_update.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 0145c2746a..b3be23858d 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -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); |