From: Bartosz DziewoƄski Date: Thu, 28 Sep 2017 12:10:31 +0000 (+0200) Subject: HTMLFormField: Treat weird ' ' labels as empty in OOUI mode X-Git-Tag: 1.31.0-rc.0~1855^2~1 X-Git-Url: http://git.cyclocoop.org/%22.%28%24lien.?a=commitdiff_plain;h=59ab21b0ab59467001852b6eb9a9e58ff9145d2e;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 ); }