From: umherirrender Date: Sun, 28 Jun 2015 19:50:01 +0000 (+0200) Subject: Pass user to WikiPage::doDeleteArticleReal X-Git-Tag: 1.31.0-rc.0~10917^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=f9814f6773e39adf12ec1d99adc6d689a0ef1547 Pass user to WikiPage::doDeleteArticleReal This avoids use of $wgUser in WikiPage::doDeleteArticleReal Change-Id: Iacbcd998a4470c583d839824baf8b8f8e37a0d4b --- diff --git a/includes/api/ApiDelete.php b/includes/api/ApiDelete.php index d8b57182c4..6279dfdef8 100644 --- a/includes/api/ApiDelete.php +++ b/includes/api/ApiDelete.php @@ -131,7 +131,7 @@ class ApiDelete extends ApiBase { $error = ''; // Luckily, Article.php provides a reusable delete function that does the hard work for us - return $page->doDeleteArticleReal( $reason, false, 0, true, $error ); + return $page->doDeleteArticleReal( $reason, false, 0, true, $error, $user ); } /** diff --git a/includes/page/Article.php b/includes/page/Article.php index a6b6b51ce8..f213f6a2cf 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -1795,8 +1795,10 @@ class Article implements Page { */ public function doDelete( $reason, $suppress = false ) { $error = ''; - $outputPage = $this->getContext()->getOutput(); - $status = $this->mPage->doDeleteArticleReal( $reason, $suppress, 0, true, $error ); + $context = $this->getContext(); + $outputPage = $context->getOutput(); + $user = $context->getUser(); + $status = $this->mPage->doDeleteArticleReal( $reason, $suppress, 0, true, $error, $user ); if ( $status->isGood() ) { $deleted = $this->getTitle()->getPrefixedText();