Use \u{00A0} instead of   or  

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

Also use \u{1F36A} instead of 🍪 for Unicode Character 'COOKIE'
(U+1F36A).

Bug: T154300
Change-Id: I13536589a4c183215785fe3352f4fc081571451b
This commit is contained in:
Fomafix 2018-08-10 20:20:42 +02:00
parent fe6ac7c3af
commit 42fca811c6
2 changed files with 12 additions and 10 deletions

View file

@ -71,7 +71,7 @@ class Hooks {
$moreLink = self::getMoreLink();
if ( $moreLink ) {
$moreLink = ' ' . Html::element(
$moreLink = "\u{00A0}" . Html::element(
'a',
[ 'href' => $moreLink ],
$sk->msg( 'cookiewarning-moreinfo-label' )->text()
@ -91,9 +91,11 @@ class Hooks {
) .
Html::closeElement( 'form' );
$cookieImage = Html::openElement( 'div', [ 'class' => 'mw-cookiewarning-cimage' ] ) .
'🍪' .
Html::closeElement( 'div' );
$cookieImage = Html::element(
'div',
[ 'class' => 'mw-cookiewarning-cimage' ],
"\u{1F36A}"
);
$isMobile = ExtensionRegistry::getInstance()->isLoaded( 'MobileFrontend' ) &&
MobileContext::singleton()->shouldDisplayMobileView();

View file

@ -98,21 +98,21 @@ class HooksTest extends MediaWikiLangTestCase {
'http://google.de',
false,
false,
'&#160;<a href="http://google.de">More information</a>',
"\u{00A0}<a href=\"http://google.de\">More information</a>",
],
[
true,
'',
'http://google.de',
false,
'&#160;<a href="http://google.de">More information</a>',
"\u{00A0}<a href=\"http://google.de\">More information</a>",
],
[
true,
'',
false,
'http://google.de',
'&#160;<a href="http://google.de">More information</a>',
"\u{00A0}<a href=\"http://google.de\">More information</a>",
],
// the config should be the used, if set (no matter if the messages are used or not)
[
@ -120,21 +120,21 @@ class HooksTest extends MediaWikiLangTestCase {
'http://google.de',
false,
'http://google123.de',
'&#160;<a href="http://google.de">More information</a>',
"\u{00A0}<a href=\"http://google.de\">More information</a>",
],
[
true,
'http://google.de',
'http://google1234.de',
'http://google123.de',
'&#160;<a href="http://google.de">More information</a>',
"\u{00A0}<a href=\"http://google.de\">More information</a>",
],
[
true,
'',
'http://google.de',
'http://google123.de',
'&#160;<a href="http://google.de">More information</a>',
"\u{00A0}<a href=\"http://google.de\">More information</a>",
],
];
}