From 2fecd3ac708788b5e720deb6fd983ba33ac1856d Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sat, 12 Mar 2011 13:45:12 +0000 Subject: [PATCH] Use Html::element() to generate the element; the url and the title attribute are now build only when really necessary --- includes/diff/DifferenceEngine.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index c06b76958d..9ec292fa11 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -1027,15 +1027,15 @@ CONTROL; $this->mOldtitle = "{$this->mOldPagetitle}" . " (" . wfMsgHtml( $editable ? 'editold' : 'viewsourceold' ) . ")"; // Add an "undo" link - $newUndo = $this->mNewPage->escapeLocalUrl( array( - 'action' => 'edit', - 'undoafter' => $this->mOldid, - 'undo' => $this->mNewid - ) ); - $htmlLink = htmlspecialchars( wfMsg( 'editundo' ) ); - $htmlTitle = Xml::expandAttributes( array( 'title' => $wgUser->getSkin()->titleAttrib( 'undo' ) ) ); if ( $editable && !$this->mOldRev->isDeleted( Revision::DELETED_TEXT ) && !$this->mNewRev->isDeleted( Revision::DELETED_TEXT ) ) { - $this->mNewtitle .= " (" . $htmlLink . ")"; + $undoLink = Html::element( 'a', array( + 'href' => $this->mNewPage->getLocalUrl( array( + 'action' => 'edit', + 'undoafter' => $this->mOldid, + 'undo' => $this->mNewid ) ), + 'title' => $wgUser->getSkin()->titleAttrib( 'undo' ) + ), wfMsg( 'editundo' ) ); + $this->mNewtitle .= ' (' . $undoLink . ')'; } if ( !$this->mOldRev->userCan( Revision::DELETED_TEXT ) ) { -- 2.20.1