From: Brion Vibber Date: Thu, 23 Sep 2004 02:25:41 +0000 (+0000) Subject: Don't produce a title attribute for external links when the link text is X-Git-Tag: 1.5.0alpha1~1866 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=d572a9d992b094be83be67048189a231ca1528e5;p=lhc%2Fweb%2Fwiklou.git Don't produce a title attribute for external links when the link text is the same as the URL. (We already don't produce a print expansion for these.) --- diff --git a/includes/Skin.php b/includes/Skin.php index 45f1f2a230..87c23d769f 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -315,6 +315,7 @@ class Skin { function getExternalLinkAttributes( $link, $text, $class='' ) { global $wgUser, $wgOut, $wgLang; + $same = ($link == $text); $link = urldecode( $link ); $link = $wgLang->checkTitleEncoding( $link ); $link = str_replace( '_', ' ', $link ); @@ -322,7 +323,7 @@ class Skin { $r = ($class != '') ? " class='$class'" : " class='external'"; - if ( 1 == $wgUser->getOption( 'hover' ) ) { + if ( !$same && $wgUser->getOption( 'hover' ) ) { $r .= " title=\"{$link}\""; } return $r; @@ -1510,8 +1511,10 @@ class Skin { $fname = 'Skin::makeLinkObj'; # Fail gracefully - if ( ! isset($nt) ) + if ( ! isset($nt) ) { + # wfDebugDieBacktrace(); return "{$prefix}{$text}{$trail}"; + } if ( $nt->isExternal() ) { $u = $nt->getFullURL(); @@ -1640,8 +1643,10 @@ class Skin { global $wgOut, $wgUser; # Fail gracefully - if ( ! isset($nt) ) + if ( ! isset($nt) ) { + # wfDebugDieBacktrace(); return "{$prefix}{$text}{$trail}"; + } $fname = 'Skin::makeBrokenLinkObj'; wfProfileIn( $fname );