From c69017e8c789679b77ce065242d75e0f5c82a4d8 Mon Sep 17 00:00:00 2001 From: Wil Mahan Date: Mon, 4 Oct 2004 20:42:51 +0000 Subject: [PATCH] Use Skin::makeExternalLink() rather than hardcoding HTML in Parser; be more careful not to slow down the common case of only one language variant. --- includes/Parser.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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; -- 2.20.1