From 5b86b45ea23028d93ff9286d32fdd533a974eb4a Mon Sep 17 00:00:00 2001 From: Rob Church Date: Tue, 4 Apr 2006 08:35:00 +0000 Subject: [PATCH] Prevent registration/login with the username "MediaWiki default" --- RELEASE-NOTES | 1 + includes/SpecialUserlogin.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 6382a73734..36e2e5ee39 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -366,6 +366,7 @@ Security: * XSS issue : now sanitize search query input (fixed in 1.5rc3) * Remove deprecated $wgOnlySysopsCanPatrol references; use User::isAllowed( 'patrol' ) per bug 5282. Patch by Alan Harder. +* Prevent registration/login with the username "MediaWiki default" Special Pages: * Rearranged Special:Movepage form to reduce confusion between destination diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index ef5805160f..b6c7ef498d 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -206,7 +206,7 @@ class LoginForm { $name = trim( $this->mName ); $u = User::newFromName( $name ); - if ( is_null( $u ) ) { + if ( is_null( $u ) || $u->getName() = 'MediaWiki default' ) { $this->mainLoginForm( wfMsg( 'noname' ) ); return false; } @@ -293,7 +293,7 @@ class LoginForm { return; } $u = User::newFromName( $this->mName ); - if( is_null( $u ) ) { + if( is_null( $u ) || $u->getName() == 'MediaWiki default' ) { $this->mainLoginForm( wfMsg( 'noname' ) ); return; } -- 2.20.1