Merge "Remove a test case from PHPSessionHandlerTest::testSessionHandling()"
[lhc/web/wiklou.git] / includes / htmlform / HTMLButtonField.php
index 1c4daf3..64fe7ed 100644 (file)
@@ -6,7 +6,7 @@
  * wish to add a submit button to a form.
  *
  * Additional recognized configuration parameters include:
- * - flags: OOUI flags for the button, see OOUI\\FlaggedElement
+ * - flags: OOUI flags for the button, see OOUI\FlaggedElement
  * - buttonlabel-message: Message to use for the button display text, instead
  *   of the value from 'default'. Overrides 'buttonlabel' and 'buttonlabel-raw'.
  * - buttonlabel: Text to display for the button display text, instead
@@ -35,16 +35,7 @@ class HTMLButtonField extends HTMLFormField {
 
                # Generate the label from a message, if possible
                if ( isset( $info['buttonlabel-message'] ) ) {
-                       $msgInfo = $info['buttonlabel-message'];
-
-                       if ( is_array( $msgInfo ) ) {
-                               $msg = array_shift( $msgInfo );
-                       } else {
-                               $msg = $msgInfo;
-                               $msgInfo = [];
-                       }
-
-                       $this->buttonLabel = $this->msg( $msg, $msgInfo )->parse();
+                       $this->buttonLabel = $this->getMessage( $info['buttonlabel-message'] )->parse();
                } elseif ( isset( $info['buttonlabel'] ) ) {
                        if ( $info['buttonlabel'] === ' ' ) {
                                // Apparently some things set &nbsp directly and in an odd format