From: Jeroen De Dauw Date: Tue, 6 Mar 2012 00:32:48 +0000 (+0000) Subject: fix support for passing args to help-message(s), which was documented to be there... X-Git-Tag: 1.31.0-rc.0~24372 X-Git-Url: http://git.cyclocoop.org/%22.%24redirect_annul.%22?a=commitdiff_plain;h=630ea0195f8a04282ea8e5080261652e75af4d25;p=lhc%2Fweb%2Fwiklou.git fix support for passing args to help-message(s), which was documented to be there but actually missing --- diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index ac035cf2e1..b1ae4eaede 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -1086,7 +1086,9 @@ abstract class HTMLFormField { $helptext = null; if ( isset( $this->mParams['help-message'] ) ) { - $msg = wfMessage( $this->mParams['help-message'] ); + $helpMessage = (array)$this->mParams['help-message']; + $msg = wfMessage( array_shift( $helpMessage ), $helpMessage ); + if ( $msg->exists() ) { $helptext = $msg->parse(); } @@ -1095,7 +1097,9 @@ abstract class HTMLFormField { # a message key and additional parameters. This makes it impossible to pass # an array of message key foreach( $this->mParams['help-messages'] as $name ) { - $msg = wfMessage( $name ); + $helpMessage = (array)$name; + $msg = wfMessage( array_shift( $helpMessage ), $helpMessage ); + if( $msg->exists() ) { $helptext .= $msg->parse(); // append message }