From d96dec792e8be7169d2a5862df7c2dedb358cbaf Mon Sep 17 00:00:00 2001 From: Jack Phoenix Date: Sun, 24 May 2015 21:58:31 +0300 Subject: [PATCH] Made isAllowed(), showHistory() and formatRevisionRow() protected to allow for easier subclassing The Video extension adds video support to Special:Undelete by subclassing the SpecialUndelete class so that end-users don't need to hack core. Currently Video's SpecialUndeleteWithVideoSupport.php duplicates significant chunks of core SpecialUndelete.php because many SpecialUndelete methods are private. Change-Id: Ieec6c297011f2b50027840abd335b9efd54f2158 --- includes/specials/SpecialUndelete.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index f2362a188a..8a662734ff 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -756,7 +756,7 @@ class SpecialUndelete extends SpecialPage { * @param User $user * @return bool */ - private function isAllowed( $permission, User $user = null ) { + protected function isAllowed( $permission, User $user = null ) { $user = $user ? : $this->getUser(); if ( $this->mTargetObj !== null ) { return $this->mTargetObj->userCan( $permission, $user ); @@ -1206,7 +1206,7 @@ class SpecialUndelete extends SpecialPage { $repo->streamFile( $path ); } - private function showHistory() { + protected function showHistory() { $out = $this->getOutput(); if ( $this->mAllowed ) { $out->addModules( 'mediawiki.special.undelete' ); @@ -1377,7 +1377,7 @@ class SpecialUndelete extends SpecialPage { return true; } - private function formatRevisionRow( $row, $earliestLiveTime, $remaining ) { + protected function formatRevisionRow( $row, $earliestLiveTime, $remaining ) { $rev = Revision::newFromArchiveRow( $row, array( 'title' => $this->mTargetObj -- 2.20.1