Remove ugly $wgTitle usage from edit.php maintenance script
authorChad Horohoe <chadh@wikimedia.org>
Sun, 17 Nov 2013 02:03:11 +0000 (18:03 -0800)
committerChad Horohoe <chadh@wikimedia.org>
Sun, 17 Nov 2013 02:04:11 +0000 (18:04 -0800)
Change-Id: Iae44d0945a10832a7f6585d3620c8e994783457b

maintenance/edit.php

index 7c24f0f..6e69651 100644 (file)
@@ -42,7 +42,7 @@ class EditCLI extends Maintenance {
        }
 
        public function execute() {
-               global $wgUser, $wgTitle;
+               global $wgUser;
 
                $userName = $this->getOption( 'user', 'Maintenance script' );
                $summary = $this->getOption( 'summary', '' );
@@ -61,17 +61,17 @@ class EditCLI extends Maintenance {
                        $wgUser->addToDatabase();
                }
 
-               $wgTitle = Title::newFromText( $this->getArg() );
-               if ( !$wgTitle ) {
+               $title = Title::newFromText( $this->getArg() );
+               if ( !$title ) {
                        $this->error( "Invalid title", true );
                }
-               $context->setTitle( $wgTitle );
+               $context->setTitle( $title );
 
-               $page = WikiPage::factory( $wgTitle );
+               $page = WikiPage::factory( $title );
 
                # Read the text
                $text = $this->getStdin( Maintenance::STDIN_ALL );
-               $content = ContentHandler::makeContent( $text, $wgTitle );
+               $content = ContentHandler::makeContent( $text, $title );
 
                # Do the edit
                $this->output( "Saving... " );