* Blocking some Unicode whitespace characters in usernames. Should check

if some or all should be blocked from all page titles.
This commit is contained in:
Brion Vibber 2006-02-13 07:29:27 +00:00
parent 35438cbe91
commit d8261b3970
2 changed files with 18 additions and 2 deletions

View file

@ -611,6 +611,8 @@ fully support the editing toolbar, but was found to be too confusing.
* (bug 4824) Separate out IE7 CSS compat hacks, fix for RTL pages
* Added support for wikidiff2 and similar external diff engines.
* Allow cookies to be shared between multiple wikis with a shared user database
* Blocking some Unicode whitespace characters in usernames. Should check
if some or all should be blocked from all page titles.
=== Caveats ===

View file

@ -210,8 +210,22 @@ class User {
|| $parsed->getNamespace()
|| strcmp( $name, $parsed->getPrefixedText() ) )
return false;
else
return true;
// Check an additional blacklist of troublemaker characters.
// Should these be merged into the title char list?
$unicodeBlacklist = '/[' .
'\x{0080}-\x{009f}' . # iso-8859-1 control chars
'\x{00a0}' . # non-breaking space
'\x{2000}-\x{200f}' . # various whitespace
'\x{2028}-\x{202f}' . # breaks and control chars
'\x{3000}' . # ideographic space
'\x{e000}-\x{f8ff}' . # private use
']/u';
if( preg_match( $unicodeBlacklist, $name ) ) {
return false;
}
return true;
}
/**