Merge "Fix escaping issues with messages"

isekai
jenkins-bot 7 years ago committed by Gerrit Code Review
commit 8190842b4a

@ -272,15 +272,15 @@ class TimelessTemplate extends BaseTemplate {
if ( $part !== 'image' ) { if ( $part !== 'image' ) {
$titleClass = ''; $titleClass = '';
if ( $language->hasVariants() ) { if ( $language->hasVariants() ) {
$siteTitle = $language->convert( $this->getMsg( 'timeless-sitetitle' )->text() ); $siteTitle = $language->convert( $this->getMsg( 'timeless-sitetitle' )->escaped() );
} else { } else {
$siteTitle = $this->getMsg( 'timeless-sitetitle' )->text(); $siteTitle = $this->getMsg( 'timeless-sitetitle' )->escaped();
} }
// width is 11em; 13 characters will probably fit? // width is 11em; 13 characters will probably fit?
if ( mb_strlen( $siteTitle ) > 13 ) { if ( mb_strlen( $siteTitle ) > 13 ) {
$titleClass = 'long'; $titleClass = 'long';
} }
$html .= Html::element( 'a', [ $html .= Html::rawElement( 'a', [
'id' => 'p-banner', 'id' => 'p-banner',
'class' => [ 'mw-wiki-title', $titleClass ], 'class' => [ 'mw-wiki-title', $titleClass ],
'href' => $this->data['nav_urls']['mainpage']['href'] 'href' => $this->data['nav_urls']['mainpage']['href']
@ -315,7 +315,7 @@ class TimelessTemplate extends BaseTemplate {
$html .= Html::rawElement( $html .= Html::rawElement(
'h3', 'h3',
[ 'lang' => $this->get( 'userlang' ), 'dir' => $this->get( 'dir' ) ], [ 'lang' => $this->get( 'userlang' ), 'dir' => $this->get( 'dir' ) ],
Html::rawElement( 'label', [ 'for' => 'searchInput' ], $this->getMsg( 'search' )->text() ) Html::rawElement( 'label', [ 'for' => 'searchInput' ], $this->getMsg( 'search' )->escaped() )
); );
$html .= Html::rawElement( 'form', [ 'action' => $this->get( 'wgScript' ), 'id' => 'searchform' ], $html .= Html::rawElement( 'form', [ 'action' => $this->get( 'wgScript' ), 'id' => 'searchform' ],

Loading…
Cancel
Save