From e129450b4028e71cce32a95ef9337bc6d14d8a81 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 4 Dec 2007 16:20:38 +0000 Subject: 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 --- phpBB/includes/utf/utf_tools.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'phpBB/includes/utf/utf_tools.php') 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); -- cgit v1.2.1