Switch from Xml:: to Html:: in a few places
These should all theoretically be covered by the parser tests. All tests pass, the only change needed was to account for less overescaping in Html::expandAttributes(). There's no reason to escape <>' in "-quoted attributes, unless I'm mistaken and have just added some XSS.
This commit is contained in:
parent
defb1eeaf0
commit
aece69bc89
3 changed files with 8 additions and 8 deletions
|
|
@ -206,7 +206,7 @@ class Linker {
|
|||
|
||||
$ret = null;
|
||||
if( wfRunHooks( 'LinkEnd', array( $this, $target, $options, &$text, &$attribs, &$ret ) ) ) {
|
||||
$ret = Xml::openElement( 'a', $attribs ) . $text . Xml::closeElement( 'a' );
|
||||
$ret = Html::rawElement( 'a', $attribs, $text );
|
||||
}
|
||||
|
||||
wfProfileOut( __METHOD__ );
|
||||
|
|
@ -382,7 +382,7 @@ class Linker {
|
|||
wfDebug("Hook LinkerMakeExternalImage changed the output of external image with url {$url} and alt text {$alt} to {$img}\n", true);
|
||||
return $img;
|
||||
}
|
||||
return Xml::element( 'img',
|
||||
return Html::element( 'img',
|
||||
array(
|
||||
'src' => $url,
|
||||
'alt' => $alt ) );
|
||||
|
|
@ -753,7 +753,7 @@ class Linker {
|
|||
return $link;
|
||||
}
|
||||
if ( $attribs ) {
|
||||
$attribsText .= Xml::expandAttributes( $attribs );
|
||||
$attribsText .= Html::expandAttributes( $attribs );
|
||||
}
|
||||
return '<a href="'.$url.'"'.$attribsText.'>'.$text.'</a>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -268,7 +268,7 @@ class DateFormatter
|
|||
$isoDate = implode( '-', $isoBits );;
|
||||
|
||||
// Output is not strictly HTML (it's wikitext), but <span> is whitelisted.
|
||||
$text = Xml::tags( 'span',
|
||||
$text = Html::rawElement( 'span',
|
||||
array( 'class' => 'mw-formatted-date', 'title' => $isoDate ), $text );
|
||||
|
||||
return $text;
|
||||
|
|
|
|||
|
|
@ -1467,7 +1467,7 @@ Link containing "<#" and ">#" as hex sequences
|
|||
!! input
|
||||
[[%3c%23]][[%3e%23]]
|
||||
!! result
|
||||
<p>[[%3c%23]]<a href="/index.php?title=%3E&action=edit&redlink=1" class="new" title="> (page does not exist)">>#</a>
|
||||
<p>[[%3c%23]]<a href="/index.php?title=%3E&action=edit&redlink=1" class="new" title="> (page does not exist)">>#</a>
|
||||
</p>
|
||||
!! end
|
||||
|
||||
|
|
@ -3502,7 +3502,7 @@ Link to category
|
|||
!! input
|
||||
[[:Category:MediaWiki User's Guide]]
|
||||
!! result
|
||||
<p><a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">Category:MediaWiki User's Guide</a>
|
||||
<p><a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">Category:MediaWiki User's Guide</a>
|
||||
</p>
|
||||
!! end
|
||||
|
||||
|
|
@ -3513,7 +3513,7 @@ cat
|
|||
!! input
|
||||
[[Category:MediaWiki User's Guide]]
|
||||
!! result
|
||||
<a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">MediaWiki User's Guide</a>
|
||||
<a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">MediaWiki User's Guide</a>
|
||||
!! end
|
||||
|
||||
!! test
|
||||
|
|
@ -6820,7 +6820,7 @@ language=sr cat
|
|||
!! input
|
||||
[[:Category:МедиаWики Усер'с Гуиде]]
|
||||
!! result
|
||||
<a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">MediaWiki User's Guide</a>
|
||||
<a href="/wiki/Category:MediaWiki_User%27s_Guide" title="Category:MediaWiki User's Guide">MediaWiki User's Guide</a>
|
||||
!! end
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue