r38728 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r38727‎ | r38728 | r38729 >
Date:17:35, 6 August 2008
Author:ialex
Status:old
Tags:
Comment:
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)
Modified paths:
  • /trunk/phase3/includes/specials/SpecialRecentchanges.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialRecentchangeslinked.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialRecentchangeslinked.php
@@ -163,13 +163,15 @@
164164 return $extraOpts;
165165 }
166166
167 - function setTopText( &$out, $opts ) {
168 - global $wgOut, $wgUser;
 167+ function setTopText( OutputPage $out, FormOptions $opts ) {
 168+ global $wgUser;
169169 $skin = $wgUser->getSkin();
170 - $wgOut->setSubtitle( wfMsg( 'recentchangeslinked-backlink', $skin->link( $this->mTargetTitle, $this->mTargetTitle->getPrefixedText(), array(), array( 'redirect' => 'no' ) ) ) );
 170+ if( isset( $this->mTargetTitle ) && is_object( $this->mTargetTitle ) )
 171+ $out->setSubtitle( wfMsg( 'recentchangeslinked-backlink', $skin->link( $this->mTargetTitle,
 172+ $this->mTargetTitle->getPrefixedText(), array(), array( 'redirect' => 'no' ) ) ) );
171173 }
172174
173 - function setBottomText( &$out, $opts ){
 175+ function setBottomText( OutputPage $out, FormOptions $opts ){
174176 if( isset( $this->mTargetTitle ) && is_object( $this->mTargetTitle ) ){
175177 global $wgUser;
176178 $out->setFeedAppendQuery( "target=" . urlencode( $this->mTargetTitle->getPrefixedDBkey() ) );
Index: trunk/phase3/includes/specials/SpecialRecentchanges.php
@@ -464,7 +464,7 @@
465465 * @param $out OutputPage
466466 * @param $opts FormOptions
467467 */
468 - function setTopText( &$out, $opts ){
 468+ function setTopText( OutputPage $out, FormOptions $opts ){
469469 $out->addWikiText( wfMsgForContentNoTrans( 'recentchangestext' ) );
470470 }
471471
@@ -475,7 +475,7 @@
476476 * @param $out OutputPage
477477 * @param $opts FormOptions
478478 */
479 - function setBottomText( &$out, $opts ){}
 479+ function setBottomText( OutputPage $out, FormOptions $opts ){}
480480
481481 /**
482482 * Creates the choose namespace selection

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r38707* Consistency tweaks with other special pages like move/protect/delete:...raymond12:49, 6 August 2008

Status & tagging log