Fixes for r38707:
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 6 Aug 2008 17:35:19 +0000 (17:35 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 6 Aug 2008 17:35:19 +0000 (17:35 +0000)
* $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
includes/specials/SpecialRecentchangeslinked.php

index c8b430a..2afacc8 100644 (file)
@@ -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
index 525afc3..1d042b1 100644 (file)
@@ -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() ) );