From 3cbc209ac2c20115a5a06065cf68e8b357f68310 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 4 Jun 2006 02:41:52 +0000 Subject: [PATCH] * (bug 5021) Transcluding the same special page twice now works --- RELEASE-NOTES | 1 + includes/Parser.php | 6 +++++- maintenance/parserTests.txt | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 066fb107a4..73b3fce494 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -424,6 +424,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN per-namespace basis. * Add
    to the list of block elements for doBlockLevels; avoids

    s being interspersed into your ordered lists. +* (bug 5021) Transcluding the same special page twice now works == Compatibility == diff --git a/includes/Parser.php b/includes/Parser.php index e4b9d23325..4afa23e68d 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -2918,7 +2918,11 @@ class Parser # Use the original $piece['title'] not the mangled $part1, so that # modifiers such as RAW: produce separate cache entries if( $found ) { - $this->mTemplates[$piece['title']] = $text; + if( $isHTML ) { + // A special page; don't store it in the template cache. + } else { + $this->mTemplates[$piece['title']] = $text; + } $text = $linestart . $text; } } diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index b39d6d381c..2de4bdc81c 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -4389,6 +4389,41 @@ Mixing markup for italics and bold

    !! end + +!! article +Xyzzyx +!! text +Article for special page transclusion test +!! endarticle + +!! test +Special page transclusion +!! options +!! input +{{Special:Prefixindex/Xyzzyx}} +!! result +


    +

    +
    Xyzzyx
    + +!! end + +!! test +Special page transclusion twice (bug 5021) +!! options +!! input +{{Special:Prefixindex/Xyzzyx}} +{{Special:Prefixindex/Xyzzyx}} +!! result +


    +

    +
    Xyzzyx
    +


    +

    +
    Xyzzyx
    + +!! end + # # # -- 2.20.1