From: Alexandre Emsenhuber Date: Sun, 20 Apr 2008 18:53:46 +0000 (+0000) Subject: (bug 13796) Show links to parent pages even if some of them are missing X-Git-Tag: 1.31.0-rc.0~48161 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=8e82a7029e956138522a83971eb084fb19962f64;p=lhc%2Fweb%2Fwiklou.git (bug 13796) Show links to parent pages even if some of them are missing --- 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 .= '/'; } } }