From: Philip Tzou Date: Mon, 10 Aug 2009 08:01:08 +0000 (+0000) Subject: Fix a bug of LanguageConverter::findVariantLink(). If the article has already existed... X-Git-Tag: 1.31.0-rc.0~40393 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=commitdiff_plain;h=b02b410fec97595d5c2b6dbd2046dc0980947a45;p=lhc%2Fweb%2Fwiklou.git 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. --- diff --git a/languages/LanguageConverter.php b/languages/LanguageConverter.php index 07f16194ac..4740e001fc 100644 --- a/languages/LanguageConverter.php +++ b/languages/LanguageConverter.php @@ -547,6 +547,11 @@ class LanguageConverter { * @public */ function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) { + # If the article has already existed, there is no need to + # check it again, otherwise it may cause a fault. + if ( $nt->exists() ) + return; + global $wgDisableLangConversion, $wgDisableTitleConversion, $wgRequest, $wgUser; $isredir = $wgRequest->getText( 'redirect', 'yes' ); $action = $wgRequest->getText( 'action' ); @@ -560,7 +565,7 @@ class LanguageConverter { || $action == 'submit' || $linkconvert == 'no' || $wgUser->getOption('noconvertlink') == 1 ) ) ) return; - if(is_object($nt)) + if ( is_object( $nt ) ) $ns = $nt->getNamespace(); $variants = $this->autoConvertToAllVariants($link);