From 412e981d1f8db53069b95e678365542e1e8188f0 Mon Sep 17 00:00:00 2001 From: Steve Sanbeg Date: Thu, 29 Mar 2007 19:31:25 +0000 Subject: [PATCH] fix section/size links from cached templates, so templates look teh same whether from db or cache. --- RELEASE-NOTES | 2 ++ includes/Parser.php | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 37bcb583c7..afb7f7d860 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -291,6 +291,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 5817) Special:Recentchangeslinked now shows red link for nonexistent target page instead of silently redirecting * (bug 8914) Don't transform colons in {{anchorencode:}} +* (bug 9241) Handle edit section links and include size links for cached + templates the same as the first transclusion. == Maintenance == * New script maintenance/language/checkExtensioni18n.php used to check i18n diff --git a/includes/Parser.php b/includes/Parser.php index f5fbaa2a81..b9becd5bdd 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -3032,6 +3032,19 @@ class Parser } else { # set $text to cached message. $text = $linestart . $this->mTemplates[$piece['title']]; + #treat title for cached page the same as others + $ns = NS_TEMPLATE; + $subpage = ''; + $part1 = $this->maybeDoSubpageLink( $part1, $subpage ); + if ($subpage !== '') { + $ns = $this->mTitle->getNamespace(); + } + $title = Title::newFromText( $part1, $ns ); + //used by include size checking + $titleText = $title->getPrefixedText(); + //used by edit section links + $replaceHeadings = true; + } } -- 2.20.1