r41673 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41672‎ | r41673 | r41674 >
Date:23:05, 4 October 2008
Author:mrzman
Status:old
Tags:
Comment:
Use Linker::link() in PageQueryPage instead of deprecated makeKnownLinkObj. This also avoids PHP fatal errors if for whatever reason there's an invalid title in the results.
Modified paths:
  • /trunk/phase3/includes/PageQueryPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/PageQueryPage.php
@@ -17,7 +17,9 @@
1818 public function formatResult( $skin, $row ) {
1919 global $wgContLang;
2020 $title = Title::makeTitleSafe( $row->namespace, $row->title );
21 - return $skin->makeKnownLinkObj( $title,
22 - htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) );
 21+ $text = null;
 22+ if ($title instanceof Title)
 23+ $text = htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) );
 24+ return $skin->link( $title, $text );
2325 }
2426 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r41677Cleanup for r41673, don't check for page existence.mrzman23:34, 4 October 2008

Status & tagging log