diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 340c83aff9..c9064a4a36 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -53,6 +53,7 @@
- Changelog
+ - Changes since RC-8
- Changes since RC-7
- Changes since RC-6
- Changes since RC-5
@@ -79,7 +80,13 @@
-
1.i. Changes since 3.0.RC7
+
1.i. Changes since 3.0.RC8
+
+
+ - [Fix] Cleaned usernames contain only single spaces, so "a_name" and "a__name" are treated as the same name (Bug #15634)
+
+
+
1.ii. Changes since 3.0.RC7
- [Fix] Fixed MSSQL related bug in the update system
@@ -114,7 +121,7 @@
- [Fix] No duplication of active topics (Bug #15474)
-
1.ii. Changes since 3.0.RC6
+
1.iii. Changes since 3.0.RC6
- [Fix] Submitting language changes using acp_language (Bug #14736)
@@ -124,7 +131,7 @@
- [Fix] Able to request new password (Bug #14743)
-
1.iii. Changes since 3.0.RC5
+
1.iv. Changes since 3.0.RC5
- [Feature] Removing constant PHPBB_EMBEDDED in favor of using an exit_handler(); the constant was meant to achive this more or less.
@@ -187,7 +194,7 @@
- [Sec] New password hashing mechanism for storing passwords (#i42)
-
1.iv. Changes since 3.0.RC4
+
1.v. Changes since 3.0.RC4
- [Fix] MySQL, PostgreSQL and SQLite related database fixes (Bug #13862)
@@ -238,7 +245,7 @@
- [Fix] odbc_autocommit causing existing result sets to be dropped (Bug #14182)
-
1.v. Changes since 3.0.RC3
+
1.vi. Changes since 3.0.RC3
- [Fix] Fixing some subsilver2 and prosilver style issues
@@ -347,7 +354,7 @@
-
1.vi. Changes since 3.0.RC2
+
1.vii. Changes since 3.0.RC2
- [Fix] Re-allow searching within the memberlist
@@ -393,7 +400,7 @@
-
1.vii. Changes since 3.0.RC1
+
1.viii. Changes since 3.0.RC1
- [Fix] (X)HTML issues within the templates (Bug #11255, #11255)
diff --git a/phpBB/includes/utf/utf_tools.php b/phpBB/includes/utf/utf_tools.php
index e7f144af51..b30f28aac9 100644
--- a/phpBB/includes/utf/utf_tools.php
+++ b/phpBB/includes/utf/utf_tools.php
@@ -1829,6 +1829,9 @@ function utf8_clean_string($text)
// Other control characters
$text = preg_replace('#(?:[\x00-\x1F\x7F]+|(?:\xC2[\x80-\x9F])+)#', '', $text);
+ // we need to reduce multiple spaces to a single one
+ $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);
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);