From c0cc946434185ed2b995a603cca6807267640a56 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 1 Dec 2003 23:51:41 +0000 Subject: [PATCH] Fix subpage backlinks; add more debug statements in make*Link() --- includes/Skin.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) 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; } } -- 2.20.1