$name = trim( $this->mName );
$u = User::newFromName( $name );
- if ( ( "" == $name ) ||
+ if ( is_null( $u ) ||
+ ( "" == $name ) ||
preg_match( "/\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}/", $name ) ||
(strpos( $name, "/" ) !== false) ||
(strlen( $name ) > $wgMaxNameChars) ||
return;
}
$u = User::newFromName( $this->mName );
+ if( is_null( $u ) ) {
+ $this->mainLoginForm( wfMsg( "noname" ) );
+ return;
+ }
$id = $u->idForName();
if ( 0 == $id ) {
$this->mainLoginForm( wfMsg( "nosuchuser", $u->getName() ) );
return;
}
$u = User::newFromName( $this->mName );
+ if( is_null( $u ) ) {
+ $this->mainLoginForm( wfMsg( "noname" ) );
+ return;
+ }
$id = $u->idForName();
if ( 0 == $id ) {
$this->mainLoginForm( wfMsg( "nosuchuser", $u->getName() ) );
global $wgCookiePath, $wgCookieDomain;
if ( "" == $u->getEmail() ) {
- $this->mainLoginForm( wfMsg( "noemail", $u->getName() ) );
- return;
+ return wfMsg( "noemail", $u->getName() );
}
$np = User::randomPassword();
$u->setNewpassword( $np );
$ca = wfMsg( "createaccount" );
$cam = wfMsg( "createaccountmail" );
$ye = wfMsg( "youremail" );
- if ($wgAllowRealName) {
+ if( $wgAllowRealName ) {
$yrn = wfMsg( "yourrealname" );
} else {
$yrn = '';