$link = urldecode( $link );
$link = $wgLang->checkTitleEncoding( $link );
$link = str_replace( '_', ' ', $link );
- $link = wfEscapeHTML( $link );
+ $link = htmlspecialchars( $link );
$r = ($class != '') ? " class='$class'" : " class='external'";
$link = urldecode( $link );
$link = str_replace( '_', ' ', $link );
- $link = wfEscapeHTML( $link );
+ $link = htmlspecialchars( $link );
if ( $broken == 'stub' ) {
$r = ' class="stub"';
if ( $wgOut->isArticleRelated() ) {
if ( $wgTitle->getNamespace() == Namespace::getImage() ) {
$name = $wgTitle->getDBkey();
- $link = wfEscapeHTML( Image::wfImageUrl( $name ) );
+ $link = htmlspecialchars( Image::wfImageUrl( $name ) );
$style = $this->getInternalLinkAttributes( $link, $name );
$s .= " | <a href=\"{$link}\"{$style}>{$name}</a>";
}
$t = $wgTitle->getDBkey();
$name = 'Approve this article' ;
$link = "http://test.wikipedia.org/w/magnus/wiki.phtml?title={$t}&action=submit&doit=1" ;
- #wfEscapeHTML( wfImageUrl( $name ) );
+ #htmlspecialchars( wfImageUrl( $name ) );
$style = $this->getExternalLinkAttributes( $link, $name );
$s .= " | <a href=\"{$link}\"{$style}>{$name}</a>" ;
}
function fnamePart( $url )
{
$basename = strrchr( $url, '/' );
- if ( false === $basename ) { $basename = $url; }
- else { $basename = substr( $basename, 1 ); }
- return wfEscapeHTML( $basename );
+ if ( false === $basename ) {
+ $basename = $url;
+ } else {
+ $basename = substr( $basename, 1 );
+ }
+ return htmlspecialchars( $basename );
}
function makeImage( $url, $alt = '' )
{
global $wgOut;
- if ( '' == $alt ) { $alt = $this->fnamePart( $url ); }
+ if ( '' == $alt ) {
+ $alt = $this->fnamePart( $url );
+ }
$s = '<img src="'.$url.'" alt="'.$alt.'" />';
return $s;
}
function formatComment($comment)
{
global $wgLang;
- $comment=wfEscapeHTML($comment);
+ $comment = htmlspecialchars( $comment );
# The pattern for autogen comments is / * foo * /, which makes for
# some nasty regex.
$dlink = $del;
}
} else {
- $url = wfEscapeHTML( wfImageArchiveUrl( $img ) );
+ $url = htmlspecialchars( wfImageArchiveUrl( $img ) );
if( $wgUser->getID() != 0 && $wgTitle->userCanEdit() ) {
$rlink = $this->makeKnownLink( $wgTitle->getPrefixedText(),
wfMsg( 'revertimg' ), 'action=revert&oldimage=' .