From: Alex Monk Date: Thu, 6 Jun 2013 20:20:20 +0000 (+0100) Subject: edit.php maintenance script not setting up context, just globals X-Git-Tag: 1.31.0-rc.0~19481 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=982b2ae1b48e4a4113d1efeb15798c497d69d048;p=lhc%2Fweb%2Fwiklou.git edit.php maintenance script not setting up context, just globals Was breaking one of Echo's hooks Bug: 49271 Change-Id: Ie1b5f5bc4a672bcfff3c99b9a76b37c502c09985 --- diff --git a/maintenance/edit.php b/maintenance/edit.php index 7fca6518bf..7c24f0fab7 100644 --- a/maintenance/edit.php +++ b/maintenance/edit.php @@ -52,6 +52,8 @@ class EditCLI extends Maintenance { $noRC = $this->hasOption( 'no-rc' ); $wgUser = User::newFromName( $userName ); + $context = RequestContext::getMain(); + $context->setUser( $wgUser ); if ( !$wgUser ) { $this->error( "Invalid username", true ); } @@ -63,6 +65,7 @@ class EditCLI extends Maintenance { if ( !$wgTitle ) { $this->error( "Invalid title", true ); } + $context->setTitle( $wgTitle ); $page = WikiPage::factory( $wgTitle );