From: Jens Frank Date: Mon, 19 Jul 2004 06:47:22 +0000 (+0000) Subject: BUG#983680: Test user names for validity. Patch by Emmanuel Engelhart X-Git-Tag: 1.5.0alpha1~2641 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=ea2e8d38e467af509da2fb1d73763e67c388eb1c;p=lhc%2Fweb%2Fwiklou.git BUG#983680: Test user names for validity. Patch by Emmanuel Engelhart --- diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index 700cf6cf49..5c68b846e3 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -151,10 +151,12 @@ class LoginForm { } $name = trim( $this->mName ); + $u = User::newFromName( $name ); if ( ( "" == $name ) || preg_match( "/\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}/", $name ) || (strpos( $name, "/" ) !== false) || - (strlen( $name ) > $wgMaxNameChars) ) + (strlen( $name ) > $wgMaxNameChars) || + ucFirst($name) != $u->getName() ) { $this->mainLoginForm( wfMsg( "noname" ) ); return; @@ -163,7 +165,6 @@ class LoginForm { $wgOut->readOnlyPage(); return; } - $u = User::newFromName( $name ); if ( 0 != $u->idForName() ) { $this->mainLoginForm( wfMsg( "userexists" ) );