From 8e73228dc6c76b607c80d373ed4a63fe5ce3a2ea Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 11 Sep 2007 18:22:37 +0000 Subject: [PATCH] * (bug 9252) Fix for tidy funkiness when using editintro mode --- RELEASE-NOTES | 2 ++ includes/GlobalFunctions.php | 2 +- includes/OutputPage.php | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 08925f761c..e6bf677e84 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -46,6 +46,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 11158) Fix escaping in API HTML-formatted JSON * Fixed notice when accessing special page without read permission and whitelist is not defined +* (bug 9252) Fix for tidy funkiness when using editintro mode + === API changes in 1.12 === diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 67cc1f39ee..51c3121022 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -592,7 +592,7 @@ function wfMsgExt( $key, $options ) { } elseif ( in_array('parseinline', $options) ) { $string = $wgOut->parse( $string, true, true ); $m = array(); - if( preg_match( '/^

(.*)\n?<\/p>$/sU', $string, $m ) ) { + if( preg_match( '/^

(.*)\n?<\/p>\n?$/sU', $string, $m ) ) { $string = $m[1]; } } elseif ( in_array('parsemag', $options) ) { diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 064671571a..3f69fab6c0 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -351,10 +351,12 @@ class OutputPage { wfIncrStats('pcache_not_possible'); $popts = $this->parserOptions(); - $popts->setTidy($tidy); + $oldTidy = $popts->setTidy($tidy); $parserOutput = $wgParser->parse( $text, $title, $popts, $linestart, true, $this->mRevisionId ); + + $popts->setTidy( $oldTidy ); $this->addParserOutput( $parserOutput ); -- 2.20.1