Legoktm has submitted this change and it was merged.

Change subject: Introduce ParserOutput::getRawText()
......................................................................


Introduce ParserOutput::getRawText()

Avoid polluting the parser cache with skin-dependent output from
Skin::doEditSectionLink() by introducing getRawText(), which provides
access to the uncooked text. Use this in
WikitextContent::fillParserOutput() which is the primary offender
judging by the debug logs (see referenced bug).

Bug: T124356
Change-Id: Ia9e1e4a6dc3a26f88eeebc64eed023ff20c53d58
(cherry picked from commit 914f6a62a66217b3e4304fca80e64ae1baa42d04)
---
M includes/content/WikitextContent.php
M includes/parser/ParserOutput.php
2 files changed, 12 insertions(+), 1 deletion(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/content/WikitextContent.php 
b/includes/content/WikitextContent.php
index 8beae39..89e9356 100644
--- a/includes/content/WikitextContent.php
+++ b/includes/content/WikitextContent.php
@@ -338,7 +338,7 @@
                                $chain = $this->getRedirectChain();
                                $output->setText(
                                        Article::getRedirectHeaderHtml( 
$title->getPageLanguage(), $chain, false ) .
-                                       $output->getText()
+                                       $output->getRawText()
                                );
                                $output->addModuleStyles( 
'mediawiki.action.view.redirectPage' );
                        }
diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php
index 75eea36..7ff04b8 100644
--- a/includes/parser/ParserOutput.php
+++ b/includes/parser/ParserOutput.php
@@ -220,6 +220,17 @@
                $this->mTitleText = $titletext;
        }
 
+       /**
+        * Get the cacheable text with <mw:editsection> markers still in it. The
+        * return value is suitable for writing back via setText() but is not 
valid
+        * for display to the user.
+        *
+        * @since 1.27
+        */
+       public function getRawText() {
+               return $this->mText;
+       }
+
        public function getText() {
                $this->debug_gettext_trace = wfGetAllCallers( false );
                $text = $this->mText;

-- 
To view, visit https://gerrit.wikimedia.org/r/266401
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia9e1e4a6dc3a26f88eeebc64eed023ff20c53d58
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.27.0-wmf.10
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: Cscott <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Jackmcbarn <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Tim Starling <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to