aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/utf
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2007-12-04 16:20:38 +0000
committerNils Adermann <naderman@naderman.de>2007-12-04 16:20:38 +0000
commite129450b4028e71cce32a95ef9337bc6d14d8a81 (patch)
treeae2e11f4497366aa044e97433da99e9392ff7c1c /phpBB/includes/utf
parent2ae1f1c3a8354b7f098f6cee73a136e955b47b5b (diff)
downloadforums-e129450b4028e71cce32a95ef9337bc6d14d8a81.tar
forums-e129450b4028e71cce32a95ef9337bc6d14d8a81.tar.gz
forums-e129450b4028e71cce32a95ef9337bc6d14d8a81.tar.bz2
forums-e129450b4028e71cce32a95ef9337bc6d14d8a81.tar.xz
forums-e129450b4028e71cce32a95ef9337bc6d14d8a81.zip
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
Diffstat (limited to 'phpBB/includes/utf')
-rw-r--r--phpBB/includes/utf/utf_tools.php3
1 files changed, 3 insertions, 0 deletions
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);