foreach ( $colContents as $char => $articles ) {
# Change space to non-breaking space to keep headers aligned
- $h3char = $char === ' ' ? ' ' : htmlspecialchars( $char );
+ $h3char = $char === ' ' ? "\u{00A0}" : htmlspecialchars( $char );
$ret .= '<div class="mw-category-group"><h3>' . $h3char;
$ret .= "</h3>\n";
'label', [
'for' => $selectAttribs['id'] ?? null,
], $params['label']
- ) . ' ';
+ ) . "\u{00A0}";
}
// Wrap options in a <select>
$value = false, $attribs = []
) {
list( $label, $input ) = self::inputLabelSep( $label, $name, $id, $size, $value, $attribs );
- return $label . ' ' . $input;
+ return $label . "\u{00A0}" . $input;
}
/**
public static function checkLabel( $label, $name, $id, $checked = false, $attribs = [] ) {
global $wgUseMediaWikiUIEverywhere;
$chkLabel = self::check( $name, $checked, [ 'id' => $id ] + $attribs ) .
- ' ' .
+ "\u{00A0}" .
self::label( $label, $id, $attribs );
if ( $wgUseMediaWikiUIEverywhere ) {
$checked = false, $attribs = []
) {
return self::radio( $name, $value, $checked, [ 'id' => $id ] + $attribs ) .
- ' ' .
+ "\u{00A0}" .
self::label( $label, $id, $attribs );
}
$content .= Xml::dateMenu(
( $year == null ? MWTimestamp::getLocalInstance()->format( 'Y' ) : $year ),
$month
- ) . ' ';
- $content .= $tagSelector ? ( implode( ' ', $tagSelector ) . ' ' ) : '';
+ ) . "\u{00A0}";
+ $content .= $tagSelector ? ( implode( "\u{00A0}", $tagSelector ) . "\u{00A0}" ) : '';
$content .= $checkDeleted . Html::submitButton(
$this->msg( 'historyaction-submit' )->text(),
[],
* @param string $nothing To use for empty space
* @return string
*/
- public function recentChangesFlags( $flags, $nothing = ' ' ) {
+ public function recentChangesFlags( $flags, $nothing = "\u{00A0}" ) {
$f = '';
foreach ( array_keys( $this->getConfig()->get( 'RecentChangesFlags' ) ) as $flag ) {
$f .= isset( $flags[$flag] ) && $flags[$flag]
}
if ( isset( $data['timestampLink'] ) ) {
- $line .= ' ' . $data['timestampLink'];
+ $line .= "\u{00A0}" . $data['timestampLink'];
unset( $data['timestampLink'] );
}
- $line .= ' </td>';
+ $line .= "\u{00A0}</td>";
$line .= Html::openElement( 'td', [
'class' => 'mw-changeslist-line-inner',
// Used for reliable determination of the affiliated page
$rollbackLink = Linker::generateRollback( $this->mNewRev, $this->getContext() );
if ( $rollbackLink ) {
$out->preventClickjacking();
- $rollback = '   ' . $rollbackLink;
+ $rollback = "\u{00A0}\u{00A0}\u{00A0}" . $rollbackLink;
}
}
[ 'diff' => 'prev', 'oldid' => $this->mOldid ] + $query
);
} else {
- $prevlink = ' ';
+ $prevlink = "\u{00A0}";
}
if ( $this->mOldRev->isMinor() ) {
[ 'diff' => 'next', 'oldid' => $this->mNewid ] + $query
);
} else {
- $nextlink = ' ';
+ $nextlink = "\u{00A0}";
}
if ( $this->mNewRev->isMinor() ) {
protected function revisionDeleteLink( $rev ) {
$link = Linker::getRevDeleteLink( $this->getUser(), $rev, $rev->getTitle() );
if ( $link !== '' ) {
- $link = '   ' . $link . ' ';
+ $link = "\u{00A0}\u{00A0}\u{00A0}" . $link . ' ';
}
return $link;
* @return mixed
*/
public static function escapeWhiteSpace( $msg ) {
- $msg = preg_replace( '/^ /m', '  ', $msg );
- $msg = preg_replace( '/ $/m', '  ', $msg );
- $msg = preg_replace( '/ /', '  ', $msg );
+ $msg = preg_replace( '/^ /m', "\u{00A0} ", $msg );
+ $msg = preg_replace( '/ $/m', " \u{00A0}", $msg );
+ $msg = preg_replace( '/ /', "\u{00A0} ", $msg );
return $msg;
}
* @return string
*/
protected function contextLine( $line ) {
- return $this->wrapLine( ' ', 'diff-context', $line );
+ return $this->wrapLine( "\u{00A0}", 'diff-context', $line );
}
/**
* @return string
*/
protected function emptyLine() {
- return '<td colspan="2"> </td>';
+ return "<td colspan=\"2\">\u{00A0}</td>";
}
/**
array_push( $this->lines, $this->line );
} else {
# make empty lines visible by inserting an NBSP
- array_push( $this->lines, ' ' );
+ array_push( $this->lines, "\u{00A0}" );
}
$this->line = '';
}
$html[] = $retval;
$labelValue = trim( $value->getLabel() );
- if ( $labelValue !== ' ' && $labelValue !== '' ) {
+ if ( $labelValue !== "\u{00A0}" && $labelValue !== '' ) {
$hasLabel = true;
}
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'] );
}
$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}" ) {
$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;
+ if ( is_null( $this->mLabel ) ) {
+ return '';
+ }
+ if ( $this->mLabel === ' ' ) {
+ return "\u{00A0}";
+ }
+ return $this->mLabel;
}
public function getLabelHtml( $cellAttributes = [] ) {
$labelValue = trim( $this->getLabel() );
$hasLabel = false;
- if ( $labelValue !== ' ' && $labelValue !== '' ) {
+ if ( $labelValue !== "\u{00A0}" && $labelValue !== '' ) {
$hasLabel = true;
}
if ( isset( $info['buttonlabel-message'] ) ) {
$this->buttonLabel = $this->getMessage( $info['buttonlabel-message'] )->parse();
} elseif ( isset( $info['buttonlabel'] ) ) {
- if ( $info['buttonlabel'] === ' ' ) {
+ if ( $info['buttonlabel'] === ' ' || $info['buttonlabel'] === "\u{00A0}" ) {
// Apparently some things set   directly and in an odd format
- $this->buttonLabel = ' ';
+ $this->buttonLabel = "\u{00A0}";
} else {
$this->buttonLabel = htmlspecialchars( $info['buttonlabel'] );
}
}
$chkLabel = Xml::check( $this->mName, $value, $attr ) .
- ' ' .
+ "\u{00A0}" .
Html::rawElement( 'label', $attrLabel, $this->mLabel );
if ( $wgUseMediaWikiUIEverywhere || $this->mParent instanceof VFormHTMLForm ) {
) {
return '';
} else {
- return ' ';
+ return "\u{00A0}";
}
}
$attribs = $this->getAttributes( [ 'disabled', 'tabindex' ] );
// Build the column headers
- $headerContents = Html::rawElement( 'td', [], ' ' );
+ $headerContents = Html::rawElement( 'td', [], "\u{00A0}" );
foreach ( $columns as $columnLabel => $columnTag ) {
$headerContents .= Html::rawElement( 'td', [], $columnLabel );
}
$html .= $field->$getFieldHtmlMethod( $v );
$labelValue = trim( $field->getLabel() );
- if ( $labelValue != ' ' && $labelValue !== '' ) {
+ if ( $labelValue != "\u{00A0}" && $labelValue !== '' ) {
$hasLabel = true;
}
}
* @return String
*/
public function getElement( $element ) {
- return $element . ' ' . $this->getInputHTML( '' );
+ return $element . "\u{00A0}" . $this->getInputHTML( '' );
}
}
$elementFunc = [ Html::class, $this->mOptionsLabelsNotFromMessage ? 'rawElement' : 'element' ];
$checkbox =
Xml::check( "{$this->mName}[]", $checked, $attribs ) .
- ' ' .
+ "\u{00A0}" .
call_user_func( $elementFunc,
'label',
[ 'for' => $attribs['id'] ],
$classes[] = 'mw-ui-radio';
}
$radio = Xml::radio( $this->mName, $info, $info === $value, $attribs + [ 'id' => $id ] );
- $radio .= ' ' . call_user_func( $elementFunc, 'label', [ 'for' => $id ], $label );
+ $radio .= "\u{00A0}" . call_user_func( $elementFunc, 'label', [ 'for' => $id ], $label );
$html .= ' ' . Html::rawElement(
'div',
$value >= 0,
$attribs
);
- $html .= ' ' . Xml::radioLabel(
+ $html .= "\u{00A0}" . Xml::radioLabel(
$this->msg( 'maximum-size' )->text(),
$this->mName . '-mode',
'max',
$value < 0,
$attribs
);
- $html .= ' ' . parent::getInputHTML( $value ? abs( $value ) : '' );
- $html .= ' ' . $this->msg( 'pagesize' )->parse();
+ $html .= "\u{00A0}" . parent::getInputHTML( $value ? abs( $value ) : '' );
+ $html .= "\u{00A0}" . $this->msg( 'pagesize' )->parse();
return $html;
}
*/
public function label( $msg, $forId, $contents, $helpData = "" ) {
if ( strval( $msg ) == '' ) {
- $labelText = ' ';
+ $labelText = '\u{00A0}';
} else {
$labelText = wfMessage( $msg )->escaped();
}
$items[$value] =
Xml::radio( $params['controlName'], $value, $checked, $itemAttribs ) .
- ' ' .
+ '\u{00A0}' .
Xml::tags( 'label', [ 'for' => $id ], $this->parse(
isset( $params['itemLabels'] ) ?
wfMessage( $params['itemLabels'][$value] )->plain() :
return '<p>' .
Html::element( 'img', [ 'src' => $this->getVar( 'wgRightsIcon' ) ] ) .
- '  ' .
+ '\u{00A0}\u{00A0}' .
htmlspecialchars( $this->getVar( 'wgRightsText' ) ) .
"</p>\n" .
"<p style=\"text-align: center;\">" .
// Tag filter
if ( $tagSelector ) {
- $html .= Xml::tags( 'p', null, implode( ' ', $tagSelector ) );
+ $html .= Xml::tags( 'p', null, implode( "\u{00A0}", $tagSelector ) );
}
// Filter links
// Make table header
foreach ( $fields as $field => $name ) {
if ( strval( $name ) == '' ) {
- $s .= Html::rawElement( 'th', [], ' ' ) . "\n";
+ $s .= Html::rawElement( 'th', [], "\u{00A0}" ) . "\n";
} elseif ( $this->isFieldSortable( $field ) ) {
$query = [ 'sort' => $field, 'limit' => $this->mLimit ];
$linkType = null;
$formatted = strval( $this->formatValue( $field, $value ) );
if ( $formatted == '' ) {
- $formatted = ' ';
+ $formatted = "\u{00A0}";
}
$s .= Html::rawElement( 'td', $this->getCellAttrs( $field, $value ), $formatted ) . "\n";
$filterSelection = Html::rawElement(
'div',
[],
- implode( ' ', $tagFilter )
+ implode( "\u{00A0}", $tagFilter )
);
} else {
$filterSelection = Html::rawElement( 'div', [], '' );
$this->msg( 'namespace' )->text(),
'namespace',
''
- ) . ' ' .
+ ) . "\u{00A0}" .
Html::namespaceSelector(
[ 'selected' => $this->opts['namespace'], 'all' => '' ],
[
'id' => 'namespace',
'class' => 'namespaceselector',
]
- ) . ' ' .
+ ) . "\u{00A0}" .
Html::rawElement(
'span',
[ 'class' => 'mw-input-with-label' ],
'title' => $this->msg( 'tooltip-invert' )->text(),
'class' => 'mw-input'
]
- ) . ' '
+ ) . "\u{00A0}"
) .
Html::rawElement( 'span', [ 'class' => 'mw-input-with-label' ],
Xml::checkLabel(
'title' => $this->msg( 'tooltip-namespace_association' )->text(),
'class' => 'mw-input'
]
- ) . ' '
+ ) . "\u{00A0}"
)
);
Html::label(
$this->msg( 'emailusername' )->text(),
'emailusertarget'
- ) . ' ' .
+ ) . "\u{00A0}" .
Html::input(
'target',
$name,
'</td>
<td class="mw-input">' .
Xml::input( 'wpComment', 50, $this->mComment, [ 'id' => 'wpComment' ] ) .
- '</td>
+ "</td>
</tr>
<tr>
- <td> </td>
- <td class="mw-submit">' .
+ <td>\u{00A0}</td>
+ <td class=\"mw-submit\">" .
Xml::submitButton(
$this->msg( 'mergehistory-submit' )->text(),
[ 'name' => 'merge', 'id' => 'mw-merge-submit' ]
$this->msg( 'watchlist-unwatch' )->text(), [
'class' => 'mw-unwatch-link',
'title' => $this->msg( 'tooltip-ca-unwatch' )->text()
- ], [ 'action' => 'unwatch' ] ) . ' ';
+ ], [ 'action' => 'unwatch' ] ) . "\u{00A0}";
}
} );
}
]
);
- $f .= ' ' .
+ $f .= "\u{00A0}" .
Xml::checkLabel(
$this->msg( 'invert' )->text(),
'invert',
$formatted = strval( $this->formatValue( 'am_actual', $row->am_actual ) );
if ( $formatted === '' ) {
- $formatted = ' ';
+ $formatted = "\u{00A0}";
}
$s .= Xml::tags( 'td', $this->getCellAttrs( 'am_actual', $row->am_actual ), $formatted )
);
$this->assertEquals(
- '<label for="mw-test-namespace">Select a namespace:</label> ' .
+ '<label for="mw-test-namespace">Select a namespace:</label>' . "\u{00A0}" .
'<select id="mw-test-namespace" name="wpNamespace">' . "\n" .
'<option value="all">all</option>' . "\n" .
'<option value="0">(Main)</option>' . "\n" .
);
$this->assertEquals(
- '<label for="namespace">Select a namespace:</label> ' .
+ '<label for="namespace">Select a namespace:</label>' . "\u{00A0}" .
'<select id="namespace" name="namespace">' . "\n" .
'<option value="0">(Main)</option>' . "\n" .
'<option value="1">Talk</option>' . "\n" .
$preferences[$k] = [
'type' => 'text',
'section' => 'test',
- 'label' => ' ',
+ 'label' => "\u{00A0}",
];
}
],
],
'section' => 'test',
- 'label' => ' ',
+ 'label' => "\u{00A0}",
'prefix' => 'testmultiselect-',
'default' => [],
];