From: Brion Vibber Date: Mon, 1 Dec 2003 23:51:41 +0000 (+0000) Subject: Fix subpage backlinks; add more debug statements in make*Link() X-Git-Tag: 1.1.0~36 X-Git-Url: http://git.cyclocoop.org/geomaker.php?a=commitdiff_plain;h=c0cc946434185ed2b995a603cca6807267640a56;p=lhc%2Fweb%2Fwiklou.git Fix subpage backlinks; add more debug statements in make*Link() --- diff --git a/includes/Skin.php b/includes/Skin.php index c1c3e3144c..d07a7b8a86 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -487,19 +487,19 @@ class Skin { $sub = wfMsg( "fromwikipedia" ) . $wgExtraSubtitle; } if($wgOut->isArticle() && $wgNamespacesWithSubpages[$wgTitle->getNamespace()]) { - $ptext=$wgTitle->getPrefixedText(); - if(preg_match("/\//",$ptext)) { - $sub.="

"; + $ptext=$wgTitle->getPrefixedText(); + if(preg_match("/\//",$ptext)) { + $sub.="

"; $links=explode("/",$ptext); $c=0; $growinglink=""; foreach($links as $link) { $c++; - if ($cmakeLink( $growingLink, $link); + if ($cmakeLink( $growinglink, $link ); if(preg_match("/class='new'/i",$getlink)) { break; } # this is a hack, but it saves time - if ($c>1) { + if ($c>1) { $sub .= " | "; } else { $sub .="< "; @@ -511,7 +511,7 @@ class Skin { } } } - $s = "

{$sub}\n"; + $s = "

{$sub}\n"; return $s; } @@ -1196,6 +1196,7 @@ class Skin { if ($nt) { $result = $this->makeLinkObj( Title::newFromText( $title ), $text, $query, $trail ); } else { + wfDebug( "Invalid title passed to Skin::makeLink(): \"$title\"\n" ); $result = $text == "" ? $title : $text; } @@ -1208,6 +1209,7 @@ class Skin { if ($nt) { return $this->makeKnownLinkObj( Title::newFromText( $title ), $text, $query, $trail ); } else { + wfDebug( "Invalid title passed to Skin::makeKnownLink(): \"$title\"\n" ); return $text == "" ? $title : $text; } } @@ -1217,6 +1219,7 @@ class Skin { if ($nt) { return $this->makeBrokenLinkObj( Title::newFromText( $title ), $text, $query, $trail ); } else { + wfDebug( "Invalid title passed to Skin::makeBrokenLink(): \"$title\"\n" ); return $text == "" ? $title : $text; } } @@ -1226,6 +1229,7 @@ class Skin { if ($nt) { return $this->makeStubLinkObj( Title::newFromText( $title ), $text, $query, $trail ); } else { + wfDebug( "Invalid title passed to Skin::makeStubLink(): \"$title\"\n" ); return $text == "" ? $title : $text; } }