From: aude Date: Fri, 25 Jul 2014 15:53:52 +0000 (+0200) Subject: Move adjustment of revision delete target in SpecialRevisiondelete to fix fatal X-Git-Tag: 1.31.0-rc.0~14757 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=570b6bdffee3ef1a81cfc83f0fdb7d8a15ea77a6;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 ) ) {