X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Fedit.php;h=7c24f0fab7a6c8f548a1c21fb6faa3cfab422d46;hb=dd7d5db7ab001c7a4ed722e2f5295e335bab79ec;hp=93fc3e79fbfa9a94b0da09405e560b610b526c03;hpb=cfdf23952dac41ac78dd97e670295098348604cd;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/edit.php b/maintenance/edit.php index 93fc3e79fb..7c24f0fab7 100644 --- a/maintenance/edit.php +++ b/maintenance/edit.php @@ -21,7 +21,7 @@ * @ingroup Maintenance */ -require_once( __DIR__ . '/Maintenance.php' ); +require_once __DIR__ . '/Maintenance.php'; /** * Maintenance script to make a page edit. @@ -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 ); @@ -92,4 +95,4 @@ class EditCLI extends Maintenance { } $maintClass = "EditCLI"; -require_once( RUN_MAINTENANCE_IF_MAIN ); +require_once RUN_MAINTENANCE_IF_MAIN;