From 570b6bdffee3ef1a81cfc83f0fdb7d8a15ea77a6 Mon Sep 17 00:00:00 2001 From: aude Date: Fri, 25 Jul 2014 17:53:52 +0200 Subject: [PATCH] Move adjustment of revision delete target in SpecialRevisiondelete to fix fatal targetObj needs to be set correctly before accessing the RevisionList, and trying to get the 'current'. If not set correctly, then $title given to RevisionList (and it's subclasses) is Special:Revisiondelete and rev_page is 0. So nothing is found for 'current' and a fatal error happens. Follow-up to Id1baacb Bug: 68566 Change-Id: Ic078af5417798db1b2900057dbf7514112e94b46 --- includes/specials/SpecialRevisiondelete.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/includes/specials/SpecialRevisiondelete.php b/includes/specials/SpecialRevisiondelete.php index 9cec8473e6..93df28905b 100644 --- a/includes/specials/SpecialRevisiondelete.php +++ b/includes/specials/SpecialRevisiondelete.php @@ -160,6 +160,14 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { if ( !$this->typeName || count( $this->ids ) == 0 ) { throw new ErrorPageError( 'revdelete-nooldid-title', 'revdelete-nooldid-text' ); } + + # Allow the list type to adjust the passed target + $this->targetObj = RevisionDeleter::suggestTarget( + $this->typeName, + $this->targetObj, + $this->ids + ); + $this->typeLabels = self::$UILabels[$this->typeName]; $list = $this->getList(); $list->reset(); @@ -170,13 +178,6 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { $pageIsSuppressed = $bitfield & Revision::DELETED_RESTRICTED; $this->mIsAllowed = $this->mIsAllowed && !( $canViewSuppressedOnly && $pageIsSuppressed ); - # Allow the list type to adjust the passed target - $this->targetObj = RevisionDeleter::suggestTarget( - $this->typeName, - $this->targetObj, - $this->ids - ); - $this->otherReason = $request->getVal( 'wpReason' ); # We need a target page! if ( is_null( $this->targetObj ) ) { -- 2.20.1