r49853 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49852‎ | r49853 | r49854 >
Date:03:46, 25 April 2009
Author:philip
Status:ok (Comments)
Tags:
Comment:
Allowed to find variant link when use #ifexist.
Modified paths:
  • /trunk/extensions/ParserFunctions/ParserFunctions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ParserFunctions/ParserFunctions.php
@@ -329,8 +329,10 @@
330330 return $this->ifexistCommon( $parser, false, $title, $then, $else );
331331 }
332332
333 - function ifexistCommon( &$parser, $frame, $title = '', $then = '', $else = '' ) {
334 - $title = Title::newFromText( $title );
 333+ function ifexistCommon( &$parser, $frame, $titletext = '', $then = '', $else = '' ) {
 334+ global $wgContLang;
 335+ $title = Title::newFromText( $titletext );
 336+ $wgContLang->findVariantLink( $titletext, $title, true );
335337 if ( $title ) {
336338 if( $title->getNamespace() == NS_MEDIA ) {
337339 /* If namespace is specified as NS_MEDIA, then we want to

Comments

#Comment by Tim Starling (talk | contribs)   08:54, 19 May 2009

Use camel-case, titleText not titletext.

Status & tagging log