From 50c3fdc2db6346b1025e7549bd9792e2ef2a0e22 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gerg=C5=91=20Tisza?= Date: Wed, 15 Jun 2016 17:33:22 +0200 Subject: [PATCH] Fix FakeTemplate usage in LoginSignupSpecialPage 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 | 5 ----- includes/specialpage/LoginSignupSpecialPage.php | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/includes/skins/QuickTemplate.php b/includes/skins/QuickTemplate.php index af2d5daaf8..e5d272c0cb 100644 --- a/includes/skins/QuickTemplate.php +++ b/includes/skins/QuickTemplate.php @@ -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; diff --git a/includes/specialpage/LoginSignupSpecialPage.php b/includes/specialpage/LoginSignupSpecialPage.php index 3099a9b0bb..133729ae76 100644 --- a/includes/specialpage/LoginSignupSpecialPage.php +++ b/includes/specialpage/LoginSignupSpecialPage.php @@ -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() ) { -- 2.20.1