From 88e274b346f3a7d7ee6039567bdec12b8b1b4381 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 3 Oct 2004 01:45:45 +0000 Subject: [PATCH] XHTML fix: escape links put into HTML --- includes/DifferenceEngine.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/DifferenceEngine.php b/includes/DifferenceEngine.php index b28cc13367..ae4eef2be5 100644 --- a/includes/DifferenceEngine.php +++ b/includes/DifferenceEngine.php @@ -249,8 +249,8 @@ class DifferenceEngine { $dbr =& wfGetDB( DB_SLAVE ); if ( 0 == $this->mNewid || 0 == $this->mOldid ) { $wgOut->setArticleFlag( true ); - $newLink = $wgTitle->getLocalUrl(); - $this->mPagetitle = wfMsg( 'currentrev' ); + $newLink = $wgTitle->escapeLocalUrl(); + $this->mPagetitle = htmlspecialchars( wfMsg( 'currentrev' ) ); $this->mNewtitle = "{$this->mPagetitle}"; $id = $wgTitle->getArticleID(); @@ -278,8 +278,8 @@ class DifferenceEngine { $t = $wgLang->timeanddate( $s->old_timestamp, true ); $this->mNewPage = Title::MakeTitle( $s->old_namespace, $s->old_title ); - $newLink = $wgTitle->getLocalUrl ('oldid=' . $this->mNewid); - $this->mPagetitle = wfMsg( 'revisionasof', $t ); + $newLink = $wgTitle->escapeLocalUrl ('oldid=' . $this->mNewid); + $this->mPagetitle = htmlspecialchars( wfMsg( 'revisionasof', $t ) ); $this->mNewtitle = "{$this->mPagetitle}"; $this->mNewUser = $s->old_user_text; $this->mNewComment = $s->old_comment; @@ -311,8 +311,8 @@ class DifferenceEngine { $this->mOldtext = Article::getRevisionText( $s ); $t = $wgLang->timeanddate( $s->old_timestamp, true ); - $oldLink = $this->mOldPage->getLocalUrl ('oldid=' . $this->mOldid); - $this->mOldtitle = "" . wfMsg( 'revisionasof', $t ) . ''; + $oldLink = $this->mOldPage->escapeLocalUrl ('oldid=' . $this->mOldid); + $this->mOldtitle = "" . htmlspecialchars( wfMsg( 'revisionasof', $t ) ) . ''; $this->mOldUser = $s->old_user_text; $this->mOldComment = $s->old_comment; -- 2.20.1