r11679 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r11678‎ | r11679 | r11680 >
Date:07:56, 9 November 2005
Author:vibber
Status:old
Tags:
Comment:
* Forbid usernames that can be interpreted as titles with namespaces, as that leads to hard-to-manage names.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -201,6 +201,14 @@
202202 || strlen( $name ) > $wgMaxNameChars
203203 || $name != $wgContLang->ucfirst( $name ) )
204204 return false;
 205+
 206+ // Ensure that the name can't be misresolved as a different title,
 207+ // such as with extra namespace keys at the start.
 208+ $parsed = Title::newFromText( $name );
 209+ if( is_null( $parsed )
 210+ || $parsed->getNamespace()
 211+ || strcmp( $name, $parsed->getPrefixedText() ) )
 212+ return false;
205213 else
206214 return true;
207215 }
Index: trunk/phase3/RELEASE-NOTES
@@ -214,6 +214,8 @@
215215 localizable as 'datedefault' message. Tweaked lots of languages files...
216216 * Added local message cache feature ($wgLocalMessageCache), to reduce bandwidth
217217 requirements to the memcached server.
 218+* Forbid usernames that can be interpreted as titles with namespaces, as that
 219+ leads to hard-to-manage names.
218220
219221 === Caveats ===
220222

Status & tagging log