r54698 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54697‎ | r54698 | r54699 >
Date:08:01, 10 August 2009
Author:philip
Status:ok
Tags:
Comment:
Fix a bug of LanguageConverter::findVariantLink(). If the article has already existed, there is no need to check it again, otherwise it may cause a fault.
Modified paths:
  • /trunk/phase3/languages/LanguageConverter.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/LanguageConverter.php
@@ -547,6 +547,11 @@
548548 * @public
549549 */
550550 function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) {
 551+ # If the article has already existed, there is no need to
 552+ # check it again, otherwise it may cause a fault.
 553+ if ( $nt->exists() )
 554+ return;
 555+
551556 global $wgDisableLangConversion, $wgDisableTitleConversion, $wgRequest, $wgUser;
552557 $isredir = $wgRequest->getText( 'redirect', 'yes' );
553558 $action = $wgRequest->getText( 'action' );
@@ -560,7 +565,7 @@
561566 || $action == 'submit' || $linkconvert == 'no' || $wgUser->getOption('noconvertlink') == 1 ) ) )
562567 return;
563568
564 - if(is_object($nt))
 569+ if ( is_object( $nt ) )
565570 $ns = $nt->getNamespace();
566571
567572 $variants = $this->autoConvertToAllVariants($link);

Status & tagging log