Tidy and rename WebInstallerOutput::addWikiText() to addWikiTextInterface()
authorC. Scott Ananian <cscott@cscott.net>
Fri, 21 Sep 2018 16:25:26 +0000 (12:25 -0400)
committerC. Scott Ananian <cscott@cscott.net>
Tue, 25 Sep 2018 18:47:33 +0000 (14:47 -0400)
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
includes/installer/WebInstallerDocument.php
includes/installer/WebInstallerOutput.php
includes/installer/WebInstallerWelcome.php

index 367149d..0f8a5b0 100644 (file)
@@ -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' ) );
        }
index fc1c33f..43fe748 100644 (file)
@@ -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 );
        }
index cb0092d..dd76ce9 100644 (file)
@@ -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 ) );
        }
 
index 44ff0bb..0d79484 100644 (file)
@@ -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( '<span class="success-message">' .
                                wfMessage( 'config-env-good' )->escaped() . '</span>' );
-                       $this->parent->output->addWikiText( wfMessage( 'config-copyright',
+                       $this->parent->output->addWikiTextInterface( wfMessage( 'config-copyright',
                                SpecialVersion::getCopyrightAndAuthorList() )->plain() );
                        $this->startForm();
                        $this->endForm();