<?php
/**
+ * Protect or unprotect an article.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
}
$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 );