fix support for passing args to help-message(s), which was documented to be there...
authorJeroen De Dauw <jeroendedauw@users.mediawiki.org>
Tue, 6 Mar 2012 00:32:48 +0000 (00:32 +0000)
committerJeroen De Dauw <jeroendedauw@users.mediawiki.org>
Tue, 6 Mar 2012 00:32:48 +0000 (00:32 +0000)
includes/HTMLForm.php

index ac035cf..b1ae4ea 100644 (file)
@@ -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
                                }