}
$wgUser = User::newFromName( $userName );
+ if ( !$wgUser ) {
+ $this->error( "Invalid username", true );
+ }
+
$restrictions = array( 'edit' => $protection, 'move' => $protection );
$t = Title::newFromText( $this->getArg() );
}
$maintClass = "Protect";
-require_once( DO_MAINTENANCE );
+require_once( RUN_MAINTENANCE_IF_MAIN );