$html[] = $retval;
$labelValue = trim( $value->getLabel() );
- if ( $labelValue !== "\u{00A0}" && $labelValue !== '' ) {
+ if ( $labelValue !== "\u{00A0}" && $labelValue !== ' ' && $labelValue !== '' ) {
$hasLabel = true;
}
// the element could specify, that the label doesn't need to be added
$label = $this->getLabel();
- if ( $label && $label !== "\u{00A0}" ) {
+ if ( $label && $label !== "\u{00A0}" && $label !== ' ' ) {
$config['label'] = new OOUI\HtmlSnippet( $label );
}
* @return string HTML
*/
public function getLabel() {
- if ( is_null( $this->mLabel ) ) {
- return '';
- }
- if ( $this->mLabel === ' ' ) {
- return "\u{00A0}";
- }
- return $this->mLabel;
+ return $this->mLabel ?? '';
}
public function getLabelHtml( $cellAttributes = [] ) {
$labelValue = trim( $this->getLabel() );
$hasLabel = false;
- if ( $labelValue !== "\u{00A0}" && $labelValue !== '' ) {
+ if ( $labelValue !== "\u{00A0}" && $labelValue !== ' ' && $labelValue !== '' ) {
$hasLabel = true;
}
$html .= $field->$getFieldHtmlMethod( $v );
$labelValue = trim( $field->getLabel() );
- if ( $labelValue != "\u{00A0}" && $labelValue !== '' ) {
+ if ( $labelValue !== "\u{00A0}" && $labelValue !== ' ' && $labelValue !== '' ) {
$hasLabel = true;
}
}