From 61301fbfe2a78b11e4f5b1c920e1014d982a9419 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Wed, 6 Aug 2008 17:35:19 +0000 Subject: [PATCH] Fixes for r38707: * $wgOut is already passed to the function in the $out param * Don't throw a fatal error if the target param is set but to an invalid/empty title (Fatal error: Call to a member function getPrefixedText() on a non-object in ./includes/specials/SpecialRecentchangeslinked.php on line 169) --- includes/specials/SpecialRecentchanges.php | 4 ++-- includes/specials/SpecialRecentchangeslinked.php | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index c8b430aa67..2afacc80fe 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -464,7 +464,7 @@ class SpecialRecentChanges extends SpecialPage { * @param $out OutputPage * @param $opts FormOptions */ - function setTopText( &$out, $opts ){ + function setTopText( OutputPage $out, FormOptions $opts ){ $out->addWikiText( wfMsgForContentNoTrans( 'recentchangestext' ) ); } @@ -475,7 +475,7 @@ class SpecialRecentChanges extends SpecialPage { * @param $out OutputPage * @param $opts FormOptions */ - function setBottomText( &$out, $opts ){} + function setBottomText( OutputPage $out, FormOptions $opts ){} /** * Creates the choose namespace selection diff --git a/includes/specials/SpecialRecentchangeslinked.php b/includes/specials/SpecialRecentchangeslinked.php index 525afc3dff..1d042b1754 100644 --- a/includes/specials/SpecialRecentchangeslinked.php +++ b/includes/specials/SpecialRecentchangeslinked.php @@ -163,13 +163,15 @@ class SpecialRecentchangeslinked extends SpecialRecentchanges { return $extraOpts; } - function setTopText( &$out, $opts ) { - global $wgOut, $wgUser; + function setTopText( OutputPage $out, FormOptions $opts ) { + global $wgUser; $skin = $wgUser->getSkin(); - $wgOut->setSubtitle( wfMsg( 'recentchangeslinked-backlink', $skin->link( $this->mTargetTitle, $this->mTargetTitle->getPrefixedText(), array(), array( 'redirect' => 'no' ) ) ) ); + if( isset( $this->mTargetTitle ) && is_object( $this->mTargetTitle ) ) + $out->setSubtitle( wfMsg( 'recentchangeslinked-backlink', $skin->link( $this->mTargetTitle, + $this->mTargetTitle->getPrefixedText(), array(), array( 'redirect' => 'no' ) ) ) ); } - function setBottomText( &$out, $opts ){ + function setBottomText( OutputPage $out, FormOptions $opts ){ if( isset( $this->mTargetTitle ) && is_object( $this->mTargetTitle ) ){ global $wgUser; $out->setFeedAppendQuery( "target=" . urlencode( $this->mTargetTitle->getPrefixedDBkey() ) ); -- 2.20.1