From: Gergő Tisza Date: Wed, 15 Jun 2016 15:33:22 +0000 (+0200) Subject: Fix FakeTemplate usage in LoginSignupSpecialPage X-Git-Tag: 1.31.0-rc.0~6602^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/journal.php?a=commitdiff_plain;h=50c3fdc2db6346b1025e7549bd9792e2ef2a0e22;p=lhc%2Fweb%2Fwiklou.git 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 --- 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() ) {