(bug 23375) Added ogv, oga, spx as extensions for ogg files. Patch by Derk-Jan Hartman.
[lhc/web/wiklou.git] / maintenance / protect.php
index d929211..126707a 100644 (file)
@@ -18,7 +18,7 @@
  * @ingroup Maintenance
  */
 
-require_once( "Maintenance.php" );
+require_once( dirname(__FILE__) . '/Maintenance.php' );
 
 class Protect extends Maintenance {
        public function __construct() {
@@ -46,9 +46,9 @@ class Protect extends Maintenance {
                $wgUser = User::newFromName( $userName );
                $restrictions = array( 'edit' => $protection, 'move' => $protection );
 
-               $wgTitle = Title::newFromText( $args[0] );
+               $wgTitle = Title::newFromText( $this->getArg() );
                if ( !$wgTitle ) {
-                       $this->error( "Invalid title\n", true );
+                       $this->error( "Invalid title", true );
                }
 
                $wgArticle = new Article( $wgTitle );