Fomafix has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329639 )

Change subject: Use \xc2\xa0 instead of &#160 or  
......................................................................

Use \xc2\xa0 instead of &#160 or  

Directly use the UTF-8 encoding of the 'NO-BREAK SPACE' (U+00A0) instead of
the HTML/XML entities   or   or  .

With the UTF-8 character the generated HTML is shorter and better to read.
Developer tools like Firebug can show the HTML entities from UTF-8 characters
when necessary to debug.

Bug: T154300
Change-Id: I882599ac1120789bb4e524c4394870680caca4f4
---
M includes/CategoryViewer.php
M includes/EditPage.php
M includes/Html.php
M includes/Preferences.php
M includes/Xml.php
M includes/actions/HistoryAction.php
M includes/changes/ChangesList.php
M includes/changes/EnhancedChangesList.php
M includes/diff/DifferenceEngine.php
M includes/diff/TableDiffFormatter.php
M includes/diff/WordAccumulator.php
M includes/htmlform/HTMLForm.php
M includes/htmlform/HTMLFormField.php
M includes/htmlform/fields/HTMLButtonField.php
M includes/htmlform/fields/HTMLCheckField.php
M includes/htmlform/fields/HTMLCheckMatrix.php
M includes/htmlform/fields/HTMLFormFieldCloner.php
M includes/htmlform/fields/HTMLFormFieldWithButton.php
M includes/htmlform/fields/HTMLMultiSelectField.php
M includes/htmlform/fields/HTMLRadioField.php
M includes/htmlform/fields/HTMLSizeFilterField.php
M includes/installer/WebInstaller.php
M includes/installer/WebInstallerOptions.php
M includes/logging/LogEventsList.php
M includes/page/Article.php
M includes/pager/TablePager.php
M includes/specials/SpecialContributions.php
M includes/specials/SpecialEmailuser.php
M includes/specials/SpecialMergeHistory.php
M includes/specials/SpecialProtectedtitles.php
M includes/specials/SpecialUndelete.php
M includes/specials/SpecialWhatlinkshere.php
M includes/specials/pagers/AllMessagesTablePager.php
M includes/specials/pagers/UsersPager.php
M tests/phpunit/includes/HtmlTest.php
M tests/phpunit/includes/api/ApiOptionsTest.php
36 files changed, 74 insertions(+), 74 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/39/329639/1

diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php
index 4c4b8bb..e710799 100644
--- a/includes/CategoryViewer.php
+++ b/includes/CategoryViewer.php
@@ -582,7 +582,7 @@
 
                foreach ( $colContents as $char => $articles ) {
                        # Change space to non-breaking space to keep headers 
aligned
-                       $h3char = $char === ' ' ? ' ' : htmlspecialchars( 
$char );
+                       $h3char = $char === ' ' ? "\xc2\xa0" : 
htmlspecialchars( $char );
 
                        $ret .= '<div class="mw-category-group"><h3>' . $h3char;
                        $ret .= "</h3>\n";
diff --git a/includes/EditPage.php b/includes/EditPage.php
index c11df5d..efce335 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -4040,7 +4040,7 @@
                                ];
                                $minorEditHtml =
                                        Xml::check( 'wpMinoredit', 
$checked['minor'], $attribs ) .
-                                       "&#160;<label for='wpMinoredit' 
id='mw-editpage-minoredit'" .
+                                       "\xc2\xa0<label for='wpMinoredit' 
id='mw-editpage-minoredit'" .
                                        Xml::expandAttributes( [ 'title' => 
Linker::titleAttrib( 'minoredit', 'withaccess' ) ] ) .
                                        ">{$minorLabel}</label>";
 
@@ -4064,7 +4064,7 @@
                        ];
                        $watchThisHtml =
                                Xml::check( 'wpWatchthis', $checked['watch'], 
$attribs ) .
-                               "&#160;<label for='wpWatchthis' 
id='mw-editpage-watch'" .
+                               "\xc2\xa0<label for='wpWatchthis' 
id='mw-editpage-watch'" .
                                Xml::expandAttributes( [ 'title' => 
Linker::titleAttrib( 'watch', 'withaccess' ) ] ) .
                                ">{$watchLabel}</label>";
                        if ( $wgUseMediaWikiUIEverywhere ) {
diff --git a/includes/Html.php b/includes/Html.php
index 0b6b655..65c5710 100644
--- a/includes/Html.php
+++ b/includes/Html.php
@@ -895,7 +895,7 @@
                                'label', [
                                        'for' => isset( $selectAttribs['id'] ) 
? $selectAttribs['id'] : null,
                                ], $params['label']
-                       ) . '&#160;';
+                       ) . "\xc2\xa0";
                }
 
                // Wrap options in a <select>
diff --git a/includes/Preferences.php b/includes/Preferences.php
index cf8e7b8..61931fe 100644
--- a/includes/Preferences.php
+++ b/includes/Preferences.php
@@ -589,7 +589,7 @@
                        $defaultPreferences['skin'] = [
                                'type' => 'radio',
                                'options' => $skinOptions,
-                               'label' => '&#160;',
+                               'label' => "\xc2\xa0",
                                'section' => 'rendering/skin',
                        ];
                }
@@ -659,7 +659,7 @@
                        $defaultPreferences['date'] = [
                                'type' => 'radio',
                                'options' => $dateOptions,
-                               'label' => '&#160;',
+                               'label' => "\xc2\xa0",
                                'section' => 'rendering/dateformat',
                        ];
                }
diff --git a/includes/Xml.php b/includes/Xml.php
index e124c38..5f77ae3 100644
--- a/includes/Xml.php
+++ b/includes/Xml.php
@@ -381,7 +381,7 @@
                $value = false, $attribs = []
        ) {
                list( $label, $input ) = self::inputLabelSep( $label, $name, 
$id, $size, $value, $attribs );
-               return $label . '&#160;' . $input;
+               return $label . "\xc2\xa0" . $input;
        }
 
        /**
@@ -419,7 +419,7 @@
        public static function checkLabel( $label, $name, $id, $checked = 
false, $attribs = [] ) {
                global $wgUseMediaWikiUIEverywhere;
                $chkLabel = self::check( $name, $checked, [ 'id' => $id ] + 
$attribs ) .
-                       '&#160;' .
+                       "\xc2\xa0" .
                        self::label( $label, $id, $attribs );
 
                if ( $wgUseMediaWikiUIEverywhere ) {
@@ -445,7 +445,7 @@
                $checked = false, $attribs = []
        ) {
                return self::radio( $name, $value, $checked, [ 'id' => $id ] + 
$attribs ) .
-                       '&#160;' .
+                       "\xc2\xa0" .
                        self::label( $label, $id, $attribs );
        }
 
diff --git a/includes/actions/HistoryAction.php 
b/includes/actions/HistoryAction.php
index e8aec1c..ebca34b 100644
--- a/includes/actions/HistoryAction.php
+++ b/includes/actions/HistoryAction.php
@@ -199,8 +199,8 @@
                        Xml::dateMenu(
                                ( $year == null ? 
MWTimestamp::getLocalInstance()->format( 'Y' ) : $year ),
                                $month
-                       ) . '&#160;' .
-                       ( $tagSelector ? ( implode( '&#160;', $tagSelector ) . 
'&#160;' ) : '' ) .
+                       ) . "\xc2\xa0" .
+                       ( $tagSelector ? ( implode( "\xc2\xa0", $tagSelector ) 
. "\xc2\xa0" ) : '' ) .
                        $checkDeleted .
                        Html::submitButton(
                                $this->msg( 'historyaction-submit' )->text(),
diff --git a/includes/changes/ChangesList.php b/includes/changes/ChangesList.php
index 77038ed..cdfc44a 100644
--- a/includes/changes/ChangesList.php
+++ b/includes/changes/ChangesList.php
@@ -136,7 +136,7 @@
         * @param string $nothing To use for empty space
         * @return string
         */
-       public function recentChangesFlags( $flags, $nothing = '&#160;' ) {
+       public function recentChangesFlags( $flags, $nothing = "\xc2\xa0" ) {
                $f = '';
                foreach ( array_keys( $this->getConfig()->get( 
'RecentChangesFlags' ) ) as $flag ) {
                        $f .= isset( $flags[$flag] ) && $flags[$flag]
diff --git a/includes/changes/EnhancedChangesList.php 
b/includes/changes/EnhancedChangesList.php
index d3a414b..bd9664b 100644
--- a/includes/changes/EnhancedChangesList.php
+++ b/includes/changes/EnhancedChangesList.php
@@ -682,10 +682,10 @@
                }
 
                if ( isset( $data['timestampLink'] ) ) {
-                       $line .= '&#160;' . $data['timestampLink'];
+                       $line .= "\xc2\xa0" . $data['timestampLink'];
                        unset( $data['timestampLink'] );
                }
-               $line .= '&#160;</td><td>';
+               $line .= "\xc2\xa0</td><td>";
 
                // everything else: makes it easier for extensions to add or 
remove data
                $line .= implode( '', $data );
diff --git a/includes/diff/DifferenceEngine.php 
b/includes/diff/DifferenceEngine.php
index 559a5ec..4074df7 100644
--- a/includes/diff/DifferenceEngine.php
+++ b/includes/diff/DifferenceEngine.php
@@ -308,7 +308,7 @@
                                        $rollbackLink = 
Linker::generateRollback( $this->mNewRev, $this->getContext() );
                                        if ( $rollbackLink ) {
                                                $out->preventClickjacking();
-                                               $rollback = 
'&#160;&#160;&#160;' . $rollbackLink;
+                                               $rollback = 
"\xc2\xa0\xc2\xa0\xc2\xa0" . $rollbackLink;
                                        }
                                }
 
@@ -338,7 +338,7 @@
                                        [ 'diff' => 'prev', 'oldid' => 
$this->mOldid ] + $query
                                );
                        } else {
-                               $prevlink = '&#160;';
+                               $prevlink = "\xc2\xa0";
                        }
 
                        if ( $this->mOldRev->isMinor() ) {
@@ -386,7 +386,7 @@
                                [ 'diff' => 'next', 'oldid' => $this->mNewid ] 
+ $query
                        );
                } else {
-                       $nextlink = '&#160;';
+                       $nextlink = "\xc2\xa0";
                }
 
                if ( $this->mNewRev->isMinor() ) {
@@ -579,7 +579,7 @@
        protected function revisionDeleteLink( $rev ) {
                $link = Linker::getRevDeleteLink( $this->getUser(), $rev, 
$rev->getTitle() );
                if ( $link !== '' ) {
-                       $link = '&#160;&#160;&#160;' . $link . ' ';
+                       $link = "\xc2\xa0\xc2\xa0\xc2\xa0" . $link . ' ';
                }
 
                return $link;
diff --git a/includes/diff/TableDiffFormatter.php 
b/includes/diff/TableDiffFormatter.php
index bcae746..d75edbe 100644
--- a/includes/diff/TableDiffFormatter.php
+++ b/includes/diff/TableDiffFormatter.php
@@ -44,9 +44,9 @@
         * @return mixed
         */
        public static function escapeWhiteSpace( $msg ) {
-               $msg = preg_replace( '/^ /m', '&#160; ', $msg );
-               $msg = preg_replace( '/ $/m', ' &#160;', $msg );
-               $msg = preg_replace( '/  /', '&#160; ', $msg );
+               $msg = preg_replace( '/^ /m', "\xc2\xa0 ", $msg );
+               $msg = preg_replace( '/ $/m', " \xc2\xa0", $msg );
+               $msg = preg_replace( '/  /', "\xc2\xa0 ", $msg );
 
                return $msg;
        }
@@ -124,7 +124,7 @@
         * @return string
         */
        protected function contextLine( $line ) {
-               return $this->wrapLine( '&#160;', 'diff-context', $line );
+               return $this->wrapLine( "\xc2\xa0", 'diff-context', $line );
        }
 
        /**
@@ -147,7 +147,7 @@
         * @return string
         */
        protected function emptyLine() {
-               return '<td colspan="2">&#160;</td>';
+               return "<td colspan=\"2\">\xc2\xa0</td>";
        }
 
        /**
diff --git a/includes/diff/WordAccumulator.php 
b/includes/diff/WordAccumulator.php
index a26775f..2989c53 100644
--- a/includes/diff/WordAccumulator.php
+++ b/includes/diff/WordAccumulator.php
@@ -68,7 +68,7 @@
                        array_push( $this->lines, $this->line );
                } else {
                        # make empty lines visible by inserting an NBSP
-                       array_push( $this->lines, '&#160;' );
+                       array_push( $this->lines, "\xc2\xa0" );
                }
                $this->line = '';
        }
diff --git a/includes/htmlform/HTMLForm.php b/includes/htmlform/HTMLForm.php
index 5c5a9a7..c47ba86 100644
--- a/includes/htmlform/HTMLForm.php
+++ b/includes/htmlform/HTMLForm.php
@@ -1655,7 +1655,7 @@
                                        $html[] = $retval;
 
                                        $labelValue = trim( $value->getLabel() 
);
-                                       if ( $labelValue !== '&#160;' && 
$labelValue !== '' ) {
+                                       if ( $labelValue !== "\xc2\xa0" && 
$labelValue !== '' ) {
                                                $hasLabel = true;
                                        }
 
diff --git a/includes/htmlform/HTMLFormField.php 
b/includes/htmlform/HTMLFormField.php
index 804bbff..4b937c4 100644
--- a/includes/htmlform/HTMLFormField.php
+++ b/includes/htmlform/HTMLFormField.php
@@ -397,9 +397,9 @@
                if ( isset( $params['label-message'] ) ) {
                        $this->mLabel = $this->getMessage( 
$params['label-message'] )->parse();
                } elseif ( isset( $params['label'] ) ) {
-                       if ( $params['label'] === '&#160;' ) {
+                       if ( $params['label'] === "\xc2\xa0" ) {
                                // Apparently some things set &nbsp directly 
and in an odd format
-                               $this->mLabel = '&#160;';
+                               $this->mLabel = "\xc2\xa0";
                        } else {
                                $this->mLabel = htmlspecialchars( 
$params['label'] );
                        }
@@ -547,7 +547,7 @@
                        ? $this->mParams['horizontal-label'] : false;
 
                if ( $horizontalLabel ) {
-                       $field = '&#160;' . $inputHtml . "\n$errors";
+                       $field = "\xc2\xa0" . $inputHtml . "\n$errors";
                } else {
                        $field = Html::rawElement(
                                'div',
@@ -744,7 +744,7 @@
                $label = $this->getLabelHtml( $cellAttributes );
 
                $html = "\n" . $errors .
-                       $label . '&#160;' .
+                       $label . "\xc2\xa0" .
                        $inputHtml .
                        $helptext;
 
@@ -939,7 +939,7 @@
 
                $labelValue = trim( $this->getLabel() );
                $hasLabel = false;
-               if ( $labelValue !== '&#160;' && $labelValue !== '' ) {
+               if ( $labelValue !== "\xc2\xa0" && $labelValue !== '' ) {
                        $hasLabel = true;
                }
 
diff --git a/includes/htmlform/fields/HTMLButtonField.php 
b/includes/htmlform/fields/HTMLButtonField.php
index a19bd5a..ce37d7c 100644
--- a/includes/htmlform/fields/HTMLButtonField.php
+++ b/includes/htmlform/fields/HTMLButtonField.php
@@ -46,9 +46,9 @@
                if ( isset( $info['buttonlabel-message'] ) ) {
                        $this->buttonLabel = $this->getMessage( 
$info['buttonlabel-message'] )->parse();
                } elseif ( isset( $info['buttonlabel'] ) ) {
-                       if ( $info['buttonlabel'] === '&#160;' ) {
+                       if ( $info['buttonlabel'] === "\xc2\xa0" ) {
                                // Apparently some things set &nbsp directly 
and in an odd format
-                               $this->buttonLabel = '&#160;';
+                               $this->buttonLabel = "\xc2\xa0";
                        } else {
                                $this->buttonLabel = htmlspecialchars( 
$info['buttonlabel'] );
                        }
diff --git a/includes/htmlform/fields/HTMLCheckField.php 
b/includes/htmlform/fields/HTMLCheckField.php
index b080e18..dd6ff8d 100644
--- a/includes/htmlform/fields/HTMLCheckField.php
+++ b/includes/htmlform/fields/HTMLCheckField.php
@@ -27,7 +27,7 @@
                }
 
                $chkLabel = Xml::check( $this->mName, $value, $attr ) .
-                       '&#160;' .
+                       "\xc2\xa0" .
                        Html::rawElement( 'label', $attrLabel, $this->mLabel );
 
                if ( $wgUseMediaWikiUIEverywhere || $this->mParent instanceof 
VFormHTMLForm ) {
@@ -88,7 +88,7 @@
                ) {
                        return '';
                } else {
-                       return '&#160;';
+                       return "\xc2\xa0";
                }
        }
 
diff --git a/includes/htmlform/fields/HTMLCheckMatrix.php 
b/includes/htmlform/fields/HTMLCheckMatrix.php
index 46172a5..6f6ac8a 100644
--- a/includes/htmlform/fields/HTMLCheckMatrix.php
+++ b/includes/htmlform/fields/HTMLCheckMatrix.php
@@ -88,7 +88,7 @@
                $attribs = $this->getAttributes( [ 'disabled', 'tabindex' ] );
 
                // Build the column headers
-               $headerContents = Html::rawElement( 'td', [], '&#160;' );
+               $headerContents = Html::rawElement( 'td', [], "\xc2\xa0" );
                foreach ( $columns as $columnLabel => $columnTag ) {
                        $headerContents .= Html::rawElement( 'td', [], 
$columnLabel );
                }
diff --git a/includes/htmlform/fields/HTMLFormFieldCloner.php 
b/includes/htmlform/fields/HTMLFormFieldCloner.php
index 8fb840a..a126a19 100644
--- a/includes/htmlform/fields/HTMLFormFieldCloner.php
+++ b/includes/htmlform/fields/HTMLFormFieldCloner.php
@@ -298,7 +298,7 @@
                                $html .= $field->$getFieldHtmlMethod( $v );
 
                                $labelValue = trim( $field->getLabel() );
-                               if ( $labelValue != '&#160;' && $labelValue !== 
'' ) {
+                               if ( $labelValue != "\xc2\xa0" && $labelValue 
!== '' ) {
                                        $hasLabel = true;
                                }
                        }
diff --git a/includes/htmlform/fields/HTMLFormFieldWithButton.php 
b/includes/htmlform/fields/HTMLFormFieldWithButton.php
index bcb07bd..343867c 100644
--- a/includes/htmlform/fields/HTMLFormFieldWithButton.php
+++ b/includes/htmlform/fields/HTMLFormFieldWithButton.php
@@ -70,6 +70,6 @@
         * @return String
         */
        public function getElement( $element ) {
-               return $element . '&#160;' . $this->getInputHTML( '' );
+               return $element . "\xc2\xa0" . $this->getInputHTML( '' );
        }
 }
diff --git a/includes/htmlform/fields/HTMLMultiSelectField.php 
b/includes/htmlform/fields/HTMLMultiSelectField.php
index 23044bd..3814ad3 100644
--- a/includes/htmlform/fields/HTMLMultiSelectField.php
+++ b/includes/htmlform/fields/HTMLMultiSelectField.php
@@ -97,7 +97,7 @@
                        $elementFunc = [ 'Html', 
$this->mOptionsLabelsNotFromMessage ? 'rawElement' : 'element' ];
                        $checkbox =
                                Xml::check( "{$this->mName}[]", $checked, 
$attribs ) .
-                               '&#160;' .
+                               "\xc2\xa0" .
                                call_user_func( $elementFunc,
                                        'label',
                                        [ 'for' => $attribs['id'] ],
diff --git a/includes/htmlform/fields/HTMLRadioField.php 
b/includes/htmlform/fields/HTMLRadioField.php
index 06ec372..d86c75e 100644
--- a/includes/htmlform/fields/HTMLRadioField.php
+++ b/includes/htmlform/fields/HTMLRadioField.php
@@ -96,7 +96,7 @@
                                        $classes[] = 'mw-ui-radio';
                                }
                                $radio = Xml::radio( $this->mName, $info, $info 
=== $value, $attribs + [ 'id' => $id ] );
-                               $radio .= '&#160;' . call_user_func( 
$elementFunc, 'label', [ 'for' => $id ], $label );
+                               $radio .= "\xc2\xa0" . call_user_func( 
$elementFunc, 'label', [ 'for' => $id ], $label );
 
                                $html .= ' ' . Html::rawElement(
                                        'div',
diff --git a/includes/htmlform/fields/HTMLSizeFilterField.php 
b/includes/htmlform/fields/HTMLSizeFilterField.php
index 5ad7ee3..3e79ed7 100644
--- a/includes/htmlform/fields/HTMLSizeFilterField.php
+++ b/includes/htmlform/fields/HTMLSizeFilterField.php
@@ -27,7 +27,7 @@
                        $value >= 0,
                        $attribs
                );
-               $html .= '&#160;' . Xml::radioLabel(
+               $html .= "\xc2\xa0" . Xml::radioLabel(
                        $this->msg( 'maximum-size' )->text(),
                        $this->mName . '-mode',
                        'max',
@@ -35,8 +35,8 @@
                        $value < 0,
                        $attribs
                );
-               $html .= '&#160;' . parent::getInputHTML( $value ? abs( $value 
) : '' );
-               $html .= '&#160;' . $this->msg( 'pagesize' )->parse();
+               $html .= "\xc2\xa0" . parent::getInputHTML( $value ? abs( 
$value ) : '' );
+               $html .= "\xc2\xa0" . $this->msg( 'pagesize' )->parse();
 
                return $html;
        }
diff --git a/includes/installer/WebInstaller.php 
b/includes/installer/WebInstaller.php
index c08212e..f95a06d 100644
--- a/includes/installer/WebInstaller.php
+++ b/includes/installer/WebInstaller.php
@@ -756,7 +756,7 @@
         */
        public function label( $msg, $forId, $contents, $helpData = "" ) {
                if ( strval( $msg ) == '' ) {
-                       $labelText = '&#160;';
+                       $labelText = '\xc2\xa0';
                } else {
                        $labelText = wfMessage( $msg )->escaped();
                }
@@ -1038,7 +1038,7 @@
 
                        $items[$value] =
                                Xml::radio( $params['controlName'], $value, 
$checked, $itemAttribs ) .
-                               '&#160;' .
+                               '\xc2\xa0' .
                                Xml::tags( 'label', [ 'for' => $id ], 
$this->parse(
                                        isset( $params['itemLabels'] ) ?
                                                wfMessage( 
$params['itemLabels'][$value] )->plain() :
diff --git a/includes/installer/WebInstallerOptions.php 
b/includes/installer/WebInstallerOptions.php
index 0c01b64..d038ded 100644
--- a/includes/installer/WebInstallerOptions.php
+++ b/includes/installer/WebInstallerOptions.php
@@ -307,7 +307,7 @@
 
                return '<p>' .
                        Html::element( 'img', [ 'src' => $this->getVar( 
'wgRightsIcon' ) ] ) .
-                       '&#160;&#160;' .
+                       '\xc2\xa0\xc2\xa0' .
                        htmlspecialchars( $this->getVar( 'wgRightsText' ) ) .
                        "</p>\n" .
                        "<p style=\"text-align: center;\">" .
diff --git a/includes/logging/LogEventsList.php 
b/includes/logging/LogEventsList.php
index 6665336..03a6baa 100644
--- a/includes/logging/LogEventsList.php
+++ b/includes/logging/LogEventsList.php
@@ -113,7 +113,7 @@
 
                // Tag filter
                if ( $tagSelector ) {
-                       $html .= Xml::tags( 'p', null, implode( '&#160;', 
$tagSelector ) );
+                       $html .= Xml::tags( 'p', null, implode( "\xc2\xa0", 
$tagSelector ) );
                }
 
                // Filter links
diff --git a/includes/page/Article.php b/includes/page/Article.php
index 4bcb655..096a15b 100644
--- a/includes/page/Article.php
+++ b/includes/page/Article.php
@@ -1705,7 +1705,7 @@
                        Html::openElement( 'div', [ 'id' => 
'mw-deleteconfirm-table' ] ) .
                        Html::openElement( 'div', [ 'id' => 
'wpDeleteReasonListRow' ] ) .
                        Html::label( wfMessage( 'deletecomment' )->text(), 
'wpDeleteReasonList' ) .
-                       '&nbsp;' .
+                       "\xc2\xa0" .
                        Xml::listDropDown(
                                'wpDeleteReasonList',
                                wfMessage( 'deletereason-dropdown' 
)->inContentLanguage()->text(),
@@ -1717,7 +1717,7 @@
                        Html::closeElement( 'div' ) .
                        Html::openElement( 'div', [ 'id' => 'wpDeleteReasonRow' 
] ) .
                        Html::label( wfMessage( 'deleteotherreason' )->text(), 
'wpReason' ) .
-                       '&nbsp;' .
+                       "\xc2\xa0" .
                        Html::input( 'wpReason', $reason, 'text', [
                                'size' => '60',
                                'maxlength' => '255',
diff --git a/includes/pager/TablePager.php b/includes/pager/TablePager.php
index 770c1c6..7015df6 100644
--- a/includes/pager/TablePager.php
+++ b/includes/pager/TablePager.php
@@ -119,7 +119,7 @@
                // Make table header
                foreach ( $fields as $field => $name ) {
                        if ( strval( $name ) == '' ) {
-                               $s .= Html::rawElement( 'th', [], '&#160;' ) . 
"\n";
+                               $s .= Html::rawElement( 'th', [], "\xc2\xa0" ) 
. "\n";
                        } elseif ( $this->isFieldSortable( $field ) ) {
                                $query = [ 'sort' => $field, 'limit' => 
$this->mLimit ];
                                $linkType = null;
@@ -192,7 +192,7 @@
                        $formatted = strval( $this->formatValue( $field, $value 
) );
 
                        if ( $formatted == '' ) {
-                               $formatted = '&#160;';
+                               $formatted = "\xc2\xa0";
                        }
 
                        $s .= Html::rawElement( 'td', $this->getCellAttrs( 
$field, $value ), $formatted ) . "\n";
diff --git a/includes/specials/SpecialContributions.php 
b/includes/specials/SpecialContributions.php
index 40277ca..14c6007 100644
--- a/includes/specials/SpecialContributions.php
+++ b/includes/specials/SpecialContributions.php
@@ -499,7 +499,7 @@
                        $filterSelection = Html::rawElement(
                                'div',
                                [],
-                               implode( '&#160;', $tagFilter )
+                               implode( "\xc2\xa0", $tagFilter )
                        );
                } else {
                        $filterSelection = Html::rawElement( 'div', [], '' );
@@ -555,7 +555,7 @@
                                $this->msg( 'namespace' )->text(),
                                'namespace',
                                ''
-                       ) . '&#160;' .
+                       ) . "\xc2\xa0" .
                        Html::namespaceSelector(
                                [ 'selected' => $this->opts['namespace'], 'all' 
=> '' ],
                                [
@@ -563,7 +563,7 @@
                                        'id' => 'namespace',
                                        'class' => 'namespaceselector',
                                ]
-                       ) . '&#160;' .
+                       ) . "\xc2\xa0" .
                                Html::rawElement(
                                        'span',
                                        [ 'class' => 'mw-input-with-label' ],
@@ -576,7 +576,7 @@
                                                        'title' => $this->msg( 
'tooltip-invert' )->text(),
                                                        'class' => 'mw-input'
                                                ]
-                                       ) . '&#160;'
+                                       ) . "\xc2\xa0"
                                ) .
                                Html::rawElement( 'span', [ 'class' => 
'mw-input-with-label' ],
                                        Xml::checkLabel(
@@ -588,7 +588,7 @@
                                                        'title' => $this->msg( 
'tooltip-namespace_association' )->text(),
                                                        'class' => 'mw-input'
                                                ]
-                                       ) . '&#160;'
+                                       ) . "\xc2\xa0"
                                )
                );
 
diff --git a/includes/specials/SpecialEmailuser.php 
b/includes/specials/SpecialEmailuser.php
index 085b68d..cc45008 100644
--- a/includes/specials/SpecialEmailuser.php
+++ b/includes/specials/SpecialEmailuser.php
@@ -281,7 +281,7 @@
                        Html::label(
                                $this->msg( 'emailusername' )->text(),
                                'emailusertarget'
-                       ) . '&#160;' .
+                       ) . "\xc2\xa0" .
                        Html::input(
                                'target',
                                $name,
diff --git a/includes/specials/SpecialMergeHistory.php 
b/includes/specials/SpecialMergeHistory.php
index f122db8..5059dfc 100644
--- a/includes/specials/SpecialMergeHistory.php
+++ b/includes/specials/SpecialMergeHistory.php
@@ -224,11 +224,11 @@
                                        '</td>
                                        <td class="mw-input">' .
                                        Xml::input( 'wpComment', 50, 
$this->mComment, [ 'id' => 'wpComment' ] ) .
-                                       '</td>
+                                       "</td>
                                        </tr>
                                        <tr>
-                                               <td>&#160;</td>
-                                               <td class="mw-submit">' .
+                                               <td>\xc2\xa0</td>
+                                               <td class=\"mw-submit\">" .
                                        Xml::submitButton(
                                                $this->msg( 
'mergehistory-submit' )->text(),
                                                [ 'name' => 'merge', 'id' => 
'mw-merge-submit' ]
diff --git a/includes/specials/SpecialProtectedtitles.php 
b/includes/specials/SpecialProtectedtitles.php
index fa9033c..6e9863d 100644
--- a/includes/specials/SpecialProtectedtitles.php
+++ b/includes/specials/SpecialProtectedtitles.php
@@ -123,10 +123,10 @@
                return "<form action=\"$action\" method=\"get\">\n" .
                        '<fieldset>' .
                        Xml::element( 'legend', [], $this->msg( 
'protectedtitles' )->text() ) .
-                       Html::hidden( 'title', $special ) . "&#160;\n" .
-                       $this->getNamespaceMenu( $namespace ) . "&#160;\n" .
-                       $this->getLevelMenu( $level ) . "&#160;\n" .
-                       "&#160;" . Xml::submitButton( $this->msg( 
'protectedtitles-submit' )->text() ) . "\n" .
+                       Html::hidden( 'title', $special ) . "\xc2\xa0\n" .
+                       $this->getNamespaceMenu( $namespace ) . "\xc2\xa0\n" .
+                       $this->getLevelMenu( $level ) . "\xc2\xa0\n" .
+                       "\xc2\xa0" . Xml::submitButton( $this->msg( 
'protectedtitles-submit' )->text() ) . "\n" .
                        "</fieldset></form>";
        }
 
@@ -180,7 +180,7 @@
                        $options[] = Xml::option( $text, $type, $selected );
                }
 
-               return Xml::label( $this->msg( 'restriction-level' )->text(), 
$this->IdLevel ) . '&#160;' .
+               return Xml::label( $this->msg( 'restriction-level' )->text(), 
$this->IdLevel ) . "\xc2\xa0" .
                        Xml::tags( 'select',
                                [ 'id' => $this->IdLevel, 'name' => 
$this->IdLevel ],
                                implode( "\n", $options ) );
diff --git a/includes/specials/SpecialUndelete.php 
b/includes/specials/SpecialUndelete.php
index 3d51842..a10fd11 100644
--- a/includes/specials/SpecialUndelete.php
+++ b/includes/specials/SpecialUndelete.php
@@ -1416,7 +1416,7 @@
                        if ( $this->getUser()->isAllowed( 'suppressrevision' ) 
) {
                                $unsuppressBox =
                                        "<tr>
-                                               <td>&#160;</td>
+                                               <td>\xc2\xa0</td>
                                                <td class='mw-input'>" .
                                                Xml::checkLabel( $this->msg( 
'revdelete-unsuppress' )->text(),
                                                        'wpUnsuppress', 
'mw-undelete-unsuppress', $this->mUnsuppress ) .
@@ -1447,7 +1447,7 @@
                                "</td>
                        </tr>
                        <tr>
-                               <td>&#160;</td>
+                               <td>\xc2\xa0</td>
                                <td class='mw-submit'>" .
                                Xml::submitButton(
                                        $this->msg( 'undeletebtn' )->text(),
diff --git a/includes/specials/SpecialWhatlinkshere.php 
b/includes/specials/SpecialWhatlinkshere.php
index 439b6ab..0c38444 100644
--- a/includes/specials/SpecialWhatlinkshere.php
+++ b/includes/specials/SpecialWhatlinkshere.php
@@ -498,7 +498,7 @@
                        ]
                );
 
-               $f .= '&#160;' .
+               $f .= "\xc2\xa0" .
                        Xml::checkLabel(
                                $this->msg( 'invert' )->text(),
                                'invert',
diff --git a/includes/specials/pagers/AllMessagesTablePager.php 
b/includes/specials/pagers/AllMessagesTablePager.php
index efc51ef..105e2ce 100644
--- a/includes/specials/pagers/AllMessagesTablePager.php
+++ b/includes/specials/pagers/AllMessagesTablePager.php
@@ -355,7 +355,7 @@
                        $formatted = strval( $this->formatValue( 'am_actual', 
$row->am_actual ) );
 
                        if ( $formatted === '' ) {
-                               $formatted = '&#160;';
+                               $formatted = "\xc2\xa0";
                        }
 
                        $s .= Xml::tags( 'td', $this->getCellAttrs( 
'am_actual', $row->am_actual ), $formatted )
diff --git a/includes/specials/pagers/UsersPager.php 
b/includes/specials/pagers/UsersPager.php
index 901be38..d8c1050 100644
--- a/includes/specials/pagers/UsersPager.php
+++ b/includes/specials/pagers/UsersPager.php
@@ -305,14 +305,14 @@
                        'editsOnly',
                        $this->editsOnly
                );
-               $out .= '&#160;';
+               $out .= "\xc2\xa0";
                $out .= Xml::checkLabel(
                        $this->msg( 'listusers-creationsort' )->text(),
                        'creationSort',
                        'creationSort',
                        $this->creationSort
                );
-               $out .= '&#160;';
+               $out .= "\xc2\xa0";
                $out .= Xml::checkLabel(
                        $this->msg( 'listusers-desc' )->text(),
                        'desc',
diff --git a/tests/phpunit/includes/HtmlTest.php 
b/tests/phpunit/includes/HtmlTest.php
index e2ee193..409f865 100644
--- a/tests/phpunit/includes/HtmlTest.php
+++ b/tests/phpunit/includes/HtmlTest.php
@@ -328,7 +328,7 @@
                );
 
                $this->assertEquals(
-                       '<label for="mw-test-namespace">Select a 
namespace:</label>&#160;' .
+                       '<label for="mw-test-namespace">Select a 
namespace:</label>' . "\xc2\xa0" .
                                '<select id="mw-test-namespace" 
name="wpNamespace">' . "\n" .
                                '<option value="all">all</option>' . "\n" .
                                '<option value="0">(Main)</option>' . "\n" .
@@ -356,7 +356,7 @@
                );
 
                $this->assertEquals(
-                       '<label for="namespace">Select a 
namespace:</label>&#160;' .
+                       '<label for="namespace">Select a namespace:</label>' . 
"\xc2\xa0" .
                                '<select id="namespace" name="namespace">' . 
"\n" .
                                '<option value="0">(Main)</option>' . "\n" .
                                '<option value="1">Talk</option>' . "\n" .
diff --git a/tests/phpunit/includes/api/ApiOptionsTest.php 
b/tests/phpunit/includes/api/ApiOptionsTest.php
index ef70626..cc8e462 100644
--- a/tests/phpunit/includes/api/ApiOptionsTest.php
+++ b/tests/phpunit/includes/api/ApiOptionsTest.php
@@ -66,7 +66,7 @@
                        $preferences[$k] = [
                                'type' => 'text',
                                'section' => 'test',
-                               'label' => '&#160;',
+                               'label' => "\xc2\xa0",
                        ];
                }
 
@@ -81,7 +81,7 @@
                                ],
                        ],
                        'section' => 'test',
-                       'label' => '&#160;',
+                       'label' => "\xc2\xa0",
                        'prefix' => 'testmultiselect-',
                        'default' => [],
                ];

-- 
To view, visit https://gerrit.wikimedia.org/r/329639
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I882599ac1120789bb4e524c4394870680caca4f4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Fomafix <foma...@googlemail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to