revert r102636
[lhc/web/wiklou.git] / maintenance / protect.php
index 9143ad9..c304396 100644 (file)
@@ -47,6 +47,10 @@ class Protect extends Maintenance {
                }
 
                $wgUser = User::newFromName( $userName );
+               if ( !$wgUser ) {
+                       $this->error( "Invalid username", true );
+               }
+               
                $restrictions = array( 'edit' => $protection, 'move' => $protection );
 
                $t = Title::newFromText( $this->getArg() );
@@ -68,4 +72,4 @@ class Protect extends Maintenance {
 }
 
 $maintClass = "Protect";
-require_once( DO_MAINTENANCE );
+require_once( RUN_MAINTENANCE_IF_MAIN );