From 8e82a7029e956138522a83971eb084fb19962f64 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sun, 20 Apr 2008 18:53:46 +0000 Subject: [PATCH] (bug 13796) Show links to parent pages even if some of them are missing --- RELEASE-NOTES | 1 + includes/Skin.php | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 44e43c1c37..5e1ebcb36a 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -207,6 +207,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN changeable or all unchangeable * Fix fatal error on calling PAGESINCATEGORY with invalid category name * (bug 13793) Special:Whatlinkshere filters wrong - after paginating instead of before +* (bug 13796) Show links to parent pages even if some of them are missing === API changes in 1.13 === diff --git a/includes/Skin.php b/includes/Skin.php index 77b215c352..0b9e3be7fd 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -888,22 +888,28 @@ END; $ptext=$wgTitle->getPrefixedText(); if(preg_match('/\//',$ptext)) { $links = explode('/',$ptext); + array_pop( $links ); $c = 0; $growinglink = ''; + $display = ''; foreach($links as $link) { - $c++; - if ($cmakeLink( $growinglink, htmlspecialchars( $link ) ); - if(preg_match('/class="new"/i',$getlink)) { break; } # this is a hack, but it saves time + $growinglink .= $link; + $display .= $link; + $linkObj = Title::newFromText( $growinglink ); + if( $linkObj->exists() ){ + $getlink = $this->makeKnownLinkObj( $linkObj, htmlspecialchars( $display ) ); + $c++; if ($c>1) { $subpages .= ' | '; } else { $subpages .= '< '; } $subpages .= $getlink; - $growinglink .= '/'; + $display = ''; + } else { + $display .= '/'; } + $growinglink .= '/'; } } } -- 2.20.1