From 1c10bfb034e1fd028b7d821011cd95f2441e5a0e Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" Date: Fri, 21 Sep 2018 12:25:26 -0400 Subject: [PATCH] Tidy and rename WebInstallerOutput::addWikiText() to addWikiTextInterface() This change parallels the new method added to OutputPage in Ia58910164baaca608cea3b24333b7d13ed773339 and ensures that the content added is always tidied. We leave the old alias in place for now in accordance with our deprecation policy. Change-Id: I89f3398cffa771afcd5a33cfd11eb8510af3e7f7 --- includes/installer/Installer.php | 1 + includes/installer/WebInstallerDocument.php | 2 +- includes/installer/WebInstallerOutput.php | 9 +++++++++ includes/installer/WebInstallerWelcome.php | 4 ++-- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 367149d247..0f8a5b092c 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -454,6 +454,7 @@ abstract class Installer { $this->parserTitle = Title::newFromText( 'Installer' ); $this->parserOptions = new ParserOptions( $wgUser ); // language will be wrong :( + $this->parserOptions->setTidy( true ); // Don't try to access DB before user language is initialised $this->setParserLanguage( Language::factory( 'en' ) ); } diff --git a/includes/installer/WebInstallerDocument.php b/includes/installer/WebInstallerDocument.php index fc1c33f9b9..43fe7483c5 100644 --- a/includes/installer/WebInstallerDocument.php +++ b/includes/installer/WebInstallerDocument.php @@ -29,7 +29,7 @@ abstract class WebInstallerDocument extends WebInstallerPage { public function execute() { $text = $this->getFileContents(); $text = InstallDocFormatter::format( $text ); - $this->parent->output->addWikiText( $text ); + $this->parent->output->addWikiTextInterface( $text ); $this->startForm(); $this->endForm( false ); } diff --git a/includes/installer/WebInstallerOutput.php b/includes/installer/WebInstallerOutput.php index cb0092d2a6..dd76ce9242 100644 --- a/includes/installer/WebInstallerOutput.php +++ b/includes/installer/WebInstallerOutput.php @@ -89,8 +89,17 @@ class WebInstallerOutput { /** * @param string $text + * @deprecated since 1.32; use addWikiTextInterface instead */ public function addWikiText( $text ) { + wfDeprecated( __METHOD__, '1.32' ); + $this->addWikiTextInterface( $text ); + } + + /** + * @param string $text + */ + public function addWikiTextInterface( $text ) { $this->addHTML( $this->parent->parse( $text ) ); } diff --git a/includes/installer/WebInstallerWelcome.php b/includes/installer/WebInstallerWelcome.php index 44ff0bb218..0d7948495e 100644 --- a/includes/installer/WebInstallerWelcome.php +++ b/includes/installer/WebInstallerWelcome.php @@ -30,12 +30,12 @@ class WebInstallerWelcome extends WebInstallerPage { return 'continue'; } } - $this->parent->output->addWikiText( wfMessage( 'config-welcome' )->plain() ); + $this->parent->output->addWikiTextInterface( wfMessage( 'config-welcome' )->plain() ); $status = $this->parent->doEnvironmentChecks(); if ( $status->isGood() ) { $this->parent->output->addHTML( '' . wfMessage( 'config-env-good' )->escaped() . '' ); - $this->parent->output->addWikiText( wfMessage( 'config-copyright', + $this->parent->output->addWikiTextInterface( wfMessage( 'config-copyright', SpecialVersion::getCopyrightAndAuthorList() )->plain() ); $this->startForm(); $this->endForm(); -- 2.20.1