Merge "Handle null data return in HTMLForm"
[lhc/web/wiklou.git] / includes / htmlform / HTMLForm.php
index 1d27c46..8f8caf2 100644 (file)
@@ -1146,10 +1146,12 @@ class HTMLForm extends ContextSource {
                        }
                }
 
-               $html = Html::rawElement( 'span',
-                       [ 'class' => 'mw-htmlform-submit-buttons' ], "\n$buttons" ) . "\n";
+               if ( !$buttons ) {
+                       return '';
+               }
 
-               return $html;
+               return Html::rawElement( 'span',
+                       [ 'class' => 'mw-htmlform-submit-buttons' ], "\n$buttons" ) . "\n";
        }
 
        /**