aboutsummaryrefslogtreecommitdiffstats
path: root/includes/htmlform/HTMLFormField.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/htmlform/HTMLFormField.php')
-rw-r--r--includes/htmlform/HTMLFormField.php20
1 files changed, 13 insertions, 7 deletions
diff --git a/includes/htmlform/HTMLFormField.php b/includes/htmlform/HTMLFormField.php
index a70157572a07..31c72607fcba 100644
--- a/includes/htmlform/HTMLFormField.php
+++ b/includes/htmlform/HTMLFormField.php
@@ -397,9 +397,9 @@ abstract class HTMLFormField {
if ( isset( $params['label-message'] ) ) {
$this->mLabel = $this->getMessage( $params['label-message'] )->parse();
} elseif ( isset( $params['label'] ) ) {
- if ( $params['label'] === ' ' ) {
+ if ( $params['label'] === ' ' || $params['label'] === "\u{00A0}" ) {
// Apparently some things set &nbsp directly and in an odd format
- $this->mLabel = ' ';
+ $this->mLabel = "\u{00A0}";
} else {
$this->mLabel = htmlspecialchars( $params['label'] );
}
@@ -546,7 +546,7 @@ abstract class HTMLFormField {
$horizontalLabel = $this->mParams['horizontal-label'] ?? false;
if ( $horizontalLabel ) {
- $field = ' ' . $inputHtml . "\n$errors";
+ $field = "\u{00A0}" . $inputHtml . "\n$errors";
} else {
$field = Html::rawElement(
'div',
@@ -630,7 +630,7 @@ abstract class HTMLFormField {
// the element could specify, that the label doesn't need to be added
$label = $this->getLabel();
- if ( $label && $label !== ' ' ) {
+ if ( $label && $label !== "\u{00A0}" ) {
$config['label'] = new OOUI\HtmlSnippet( $label );
}
@@ -745,7 +745,7 @@ abstract class HTMLFormField {
$label = $this->getLabelHtml( $cellAttributes );
$html = "\n" . $errors .
- $label . ' ' .
+ $label . "\u{00A0}" .
$inputHtml .
$helptext;
@@ -926,7 +926,13 @@ abstract class HTMLFormField {
* @return string HTML
*/
public function getLabel() {
- return is_null( $this->mLabel ) ? '' : $this->mLabel;
+ if ( is_null( $this->mLabel ) ) {
+ return '';
+ }
+ if ( $this->mLabel === ' ' ) {
+ return "\u{00A0}";
+ }
+ return $this->mLabel;
}
public function getLabelHtml( $cellAttributes = [] ) {
@@ -940,7 +946,7 @@ abstract class HTMLFormField {
$labelValue = trim( $this->getLabel() );
$hasLabel = false;
- if ( $labelValue !== ' ' && $labelValue !== '' ) {
+ if ( $labelValue !== "\u{00A0}" && $labelValue !== '' ) {
$hasLabel = true;
}