From 8ef2eb8092b1435a81153a14ddfb16151d092ae2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sun, 15 May 2005 17:03:55 +0000 Subject: [PATCH] * & is invalid when it's unespecad inside attributes, please make sure your output matches the XML specification. * Don't use $x = wfMsg( 'foo' ); $x = str_replace( '$1', 'bar', $x ) when you can use $x = wfMsg( 'foo', 'bar' ); --- includes/SpecialValidate.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/includes/SpecialValidate.php b/includes/SpecialValidate.php index b73ae6438b..e78be0fdfa 100644 --- a/includes/SpecialValidate.php +++ b/includes/SpecialValidate.php @@ -200,14 +200,9 @@ class Validation { # This function returns a link text to the page validation statistics function link2statistics ( &$article ) { - $ret = wfMsg ( 'val_rev_stats_link' ) ; - $nt = $article->getTitle() ; - $ret = str_replace ( "$1" , $nt->getPrefixedText() , $ret ) ; - - $url = $nt->getLocalURL ( "action=validate&mode=list" ) ; - $ret = str_replace ( "$2" , $url , $ret ) ; - - return $ret ; + $nt = $article->getTitle(); + $url = htmlspecialchars( $nt->getLocalURL( 'action=validate&mode=list' ) ); + return wfMsg ( 'val_rev_stats_link', $nt->getPrefixedText(), $url ); } # Returns the timestamp of a revision based on the revision number -- 2.20.1