From: Wil Mahan Date: Mon, 4 Oct 2004 20:42:51 +0000 (+0000) Subject: Use Skin::makeExternalLink() rather than hardcoding HTML X-Git-Tag: 1.5.0alpha1~1659 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/?a=commitdiff_plain;h=c69017e8c789679b77ce065242d75e0f5c82a4d8;p=lhc%2Fweb%2Fwiklou.git Use Skin::makeExternalLink() rather than hardcoding HTML in Parser; be more careful not to slow down the common case of only one language variant. --- diff --git a/includes/Parser.php b/includes/Parser.php index 2395ace96e..f1fc4b56f9 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -981,13 +981,11 @@ class Parser # replacing any non-bracketed links $trail = $this->replaceFreeExternalLinks( $trail ); - $la = $sk->getExternalLinkAttributes( $url, $text ); - # Use the encoded URL # This means that users can paste URLs directly into the text # Funny characters like ö aren't valid in URLs anyway # This was changed in August 2004 - $s .= "{$text}{$dtrail}{$paren}{$trail}"; + $s .= $sk->makeExternalLink( $url, $text, false ) . $dtrail. $paren . $trail; } wfProfileOut( $fname ); @@ -1163,11 +1161,11 @@ class Parser //check other language variants of the link //if the article does not exist - if($nt->getArticleID() == 0) { - global $wgContLang; - $variants = $wgContLang->getVariants(); + global $wgContLang; + $variants = $wgContLang->getVariants(); + if(sizeof($variants) > 1) { $varnt = false; - if(sizeof($variants) > 1) { + if($nt->getArticleID() == 0) { foreach ( $variants as $v ) { if($v == $wgContLang->getPreferredVariant()) continue;