Fix FakeTemplate usage in LoginSignupSpecialPage
authorGergő Tisza <tgr.huwiki@gmail.com>
Wed, 15 Jun 2016 15:33:22 +0000 (17:33 +0200)
committerGergő Tisza <tgr.huwiki@gmail.com>
Wed, 15 Jun 2016 15:55:19 +0000 (17:55 +0200)
Despite the @return doctag, QuickTemplate::html does not return
template fields but prints them on stdout.

Also fix the doctags.

Bug: T137723
Change-Id: Ifb53ab5bdf3a4fac1e642fa6be1d88df6cef7bc7

includes/skins/QuickTemplate.php
includes/specialpage/LoginSignupSpecialPage.php

index af2d5da..e5d272c 100644 (file)
@@ -103,7 +103,6 @@ abstract class QuickTemplate {
        /**
         * @private
         * @param string $str
-        * @return string
         */
        function text( $str ) {
                echo htmlspecialchars( $this->data[$str] );
@@ -112,7 +111,6 @@ abstract class QuickTemplate {
        /**
         * @private
         * @param string $str
-        * @return string
         */
        function html( $str ) {
                echo $this->data[$str];
@@ -121,7 +119,6 @@ abstract class QuickTemplate {
        /**
         * @private
         * @param string $str
-        * @return string
         */
        function msg( $str ) {
                echo htmlspecialchars( $this->translator->translate( $str ) );
@@ -130,7 +127,6 @@ abstract class QuickTemplate {
        /**
         * @private
         * @param string $str
-        * @return string
         */
        function msgHtml( $str ) {
                echo $this->translator->translate( $str );
@@ -140,7 +136,6 @@ abstract class QuickTemplate {
         * An ugly, ugly hack.
         * @private
         * @param string $str
-        * @return string
         */
        function msgWiki( $str ) {
                global $wgOut;
index 3099a9b..133729a 100644 (file)
@@ -620,7 +620,7 @@ abstract class LoginSignupSpecialPage extends AuthManagerSpecialPage {
                // add pre/post text
                // header used by ConfirmEdit, CondfirmAccount, Persona, WikimediaIncubator, SemanticSignup
                // should be above the error message but HTMLForm doesn't support that
-               $form->addHeaderText( $fakeTemplate->html( 'header' ) );
+               $form->addHeaderText( $fakeTemplate->get( 'header' ) );
 
                // FIXME the old form used this for error/warning messages which does not play well with
                // HTMLForm (maybe it could with a subclass?); for now only display it for signups
@@ -633,7 +633,7 @@ abstract class LoginSignupSpecialPage extends AuthManagerSpecialPage {
                }
 
                // header used by MobileFrontend
-               $form->addHeaderText( $fakeTemplate->html( 'formheader' ) );
+               $form->addHeaderText( $fakeTemplate->get( 'formheader' ) );
 
                // blank signup footer for site customization
                if ( $this->isSignup() && $this->showExtraInformation() ) {