From f9814f6773e39adf12ec1d99adc6d689a0ef1547 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sun, 28 Jun 2015 21:50:01 +0200 Subject: [PATCH] Pass user to WikiPage::doDeleteArticleReal This avoids use of $wgUser in WikiPage::doDeleteArticleReal Change-Id: Iacbcd998a4470c583d839824baf8b8f8e37a0d4b --- includes/api/ApiDelete.php | 2 +- includes/page/Article.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) 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(); -- 2.20.1