IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/96704


Change subject: Fix HTML output arround HTMLForm's submit buttons when in vform
......................................................................

Fix HTML output arround HTMLForm's submit buttons when in vform

$html in HTMLForm::getButtons() is vrapped in a <div></div> when in
vform mode but it contains a <span> tag without its closing
counterpart, thus making the HTML invalid.

And while I'm at it: put line breaks at better places.

Change-Id: I7ffa1bdd72d95188320c1b29d1c46a5f6f434cbe
---
M includes/HTMLForm.php
1 file changed, 5 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/04/96704/1

diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php
index b60146a..da43fdc 100644
--- a/includes/HTMLForm.php
+++ b/includes/HTMLForm.php
@@ -725,7 +725,7 @@
         * @return String HTML.
         */
        function getButtons() {
-               $html = '<span class="mw-htmlform-submit-buttons">';
+               $html = '';
 
                if ( $this->mShowSubmit ) {
                        $attribs = array();
@@ -745,7 +745,7 @@
                        $attribs['class'] = array( 'mw-htmlform-submit' );
 
                        if ( $this->isVForm() ) {
-                               // mw-ui-block is necessary because the buttons 
aren't necessarily in an 
+                               // mw-ui-block is necessary because the buttons 
aren't necessarily in an
                                // immediate child div of the vform.
                                array_push( $attribs['class'], 'mw-ui-button', 
'mw-ui-big', 'mw-ui-primary', 'mw-ui-block' );
                        }
@@ -756,7 +756,7 @@
                        // but vform wants all elements inside divs to get 
spaced-out block
                        // styling.
                        if ( $this->isVForm() ) {
-                               $html = Html::rawElement( 'div', null, 
"\n$html\n" );
+                               $html = Html::rawElement( 'div', null, 
"\n$html" ) . "\n";
                        }
                }
 
@@ -788,9 +788,8 @@
                        $html .= Html::element( 'input', $attrs );
                }
 
-               $html .= '</span>';
-
-               return $html;
+               return Html::rawElement( 'span',
+                       array( 'class' => 'mw-htmlform-submit-buttons' ), 
"\n$html" );
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/96704
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7ffa1bdd72d95188320c1b29d1c46a5f6f434cbe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to