$args = func_get_args();
if ( $this->mParent ) {
- $callback = [ $this->mParent, 'msg' ];
- } else {
- $callback = 'wfMessage';
+ return $this->mParent->msg( ...$args );
}
-
- return call_user_func_array( $callback, $args );
+ return wfMessage( ...$args );
}
/**
}
if ( isset( $this->mValidationCallback ) ) {
- return call_user_func( $this->mValidationCallback, $value, $alldata, $this->mParent );
+ return ( $this->mValidationCallback )( $value, $alldata, $this->mParent );
}
return true;
public function filter( $value, $alldata ) {
if ( isset( $this->mFilterCallback ) ) {
- $value = call_user_func( $this->mFilterCallback, $value, $alldata, $this->mParent );
+ $value = ( $this->mFilterCallback )( $value, $alldata, $this->mParent );
}
return $value;
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   directly and in an odd format
- $this->mLabel = ' ';
+ $this->mLabel = "\u{00A0}";
} else {
$this->mLabel = htmlspecialchars( $params['label'] );
}
'mw-htmlform-nolabel' => ( $label === '' )
];
- $horizontalLabel = isset( $this->mParams['horizontal-label'] )
- ? $this->mParams['horizontal-label'] : false;
+ $horizontalLabel = $this->mParams['horizontal-label'] ?? false;
if ( $horizontalLabel ) {
- $field = ' ' . $inputHtml . "\n$errors";
+ $field = "\u{00A0}" . $inputHtml . "\n$errors";
} else {
$field = Html::rawElement(
'div',
// the element could specify, that the label doesn't need to be added
$label = $this->getLabel();
- if ( $label && $label !== ' ' ) {
+ if ( $label && $label !== "\u{00A0}" && $label !== ' ' ) {
$config['label'] = new OOUI\HtmlSnippet( $label );
}
$label = $this->getLabelHtml( $cellAttributes );
$html = "\n" . $errors .
- $label . ' ' .
+ $label . "\u{00A0}" .
$inputHtml .
$helptext;
* @return string HTML
*/
public function getLabel() {
- return is_null( $this->mLabel ) ? '' : $this->mLabel;
+ return $this->mLabel ?? '';
}
public function getLabelHtml( $cellAttributes = [] ) {
$labelValue = trim( $this->getLabel() );
$hasLabel = false;
- if ( $labelValue !== ' ' && $labelValue !== '' ) {
+ if ( $labelValue !== "\u{00A0}" && $labelValue !== ' ' && $labelValue !== '' ) {
$hasLabel = true;
}
$displayFormat = $this->mParent->getDisplayFormat();
$html = '';
- $horizontalLabel = isset( $this->mParams['horizontal-label'] )
- ? $this->mParams['horizontal-label'] : false;
+ $horizontalLabel = $this->mParams['horizontal-label'] ?? false;
if ( $displayFormat === 'table' ) {
$html =