From 59ab21b0ab59467001852b6eb9a9e58ff9145d2e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Thu, 28 Sep 2017 14:10:31 +0200 Subject: [PATCH] HTMLFormField: Treat weird ' ' labels as empty in OOUI mode I have no idea where this convention came from, but we had them in core until 265ff105aaa814c828a35e599ed35d0b0bb00e53 and they still appear widely in extensions. The non-OOUI code also has special handling for it (a label equalling ' ' is treated as raw HTML even when not marked as such). In OOUI-style "vertical" forms these fake labels cause a lot of unnecessary white space to appear, so let's just not display them. Change-Id: I45559fa69dc1ae4b9d048445e27a24815fe93b6d --- includes/htmlform/HTMLFormField.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/htmlform/HTMLFormField.php b/includes/htmlform/HTMLFormField.php index e642c2cdd0..9c301e6aa7 100644 --- a/includes/htmlform/HTMLFormField.php +++ b/includes/htmlform/HTMLFormField.php @@ -631,7 +631,7 @@ abstract class HTMLFormField { // the element could specify, that the label doesn't need to be added $label = $this->getLabel(); - if ( $label ) { + if ( $label && $label !== ' ' ) { $config['label'] = new OOUI\HtmlSnippet( $label ); } -- 2.20.1