* & is invalid when it's unespecad inside attributes, please make sure your
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Sun, 15 May 2005 17:03:55 +0000 (17:03 +0000)
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Sun, 15 May 2005 17:03:55 +0000 (17:03 +0000)
  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

index b73ae64..e78be0f 100644 (file)
@@ -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