From ac2a5c54c7ba3de4f2a91413b6f8a8b8d17ddafe Mon Sep 17 00:00:00 2001 From: Rob Church Date: Sat, 3 Jun 2006 12:57:51 +0000 Subject: [PATCH] (bug 6184) Use shinier Linker::userLink() to make user links in Special:Undelete --- RELEASE-NOTES | 2 +- includes/SpecialUndelete.php | 27 +++++++++++++-------------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 993e0f5180..fcb2edf668 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -416,7 +416,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN tag. The sanitizer still needs to learn how to make well-formed XML in this case. * Fix fatal error when specifying illegal name for manual thumbnail - +* (bug 6184) Use shinier Linker::userLink() to make user links in Special:Undelete == Compatibility == diff --git a/includes/SpecialUndelete.php b/includes/SpecialUndelete.php index 1e917da87b..eff9c25dec 100644 --- a/includes/SpecialUndelete.php +++ b/includes/SpecialUndelete.php @@ -474,6 +474,17 @@ class UndeleteForm { # List all stored revisions $revisions = $archive->listRevisions(); + + # Batch existence check on user and talk pages + if( $revisions->numRows() > 0 ) { + $batch = new LinkBatch(); + while( $row = $revisions->fetchObject() ) { + $batch->addObj( Title::makeTitleSafe( NS_USER, $row->ar_user_text ) ); + $batch->addObj( Title::makeTitleSafe( NS_USER_TALK, $row->ar_user_text ) ); + } + $batch->execute(); + $revisions->seek( 0 ); + } if ( $this->mAllowed ) { $titleObj = Title::makeTitle( NS_SPECIAL, "Undelete" ); @@ -496,12 +507,9 @@ class UndeleteForm { $wgOut->addHTML( "

" . htmlspecialchars( wfMsg( "history" ) ) . "

\n" ); if( $this->mAllowed ) { - # Brief explanation of how it all works - $wgOut->addHtml( '
' ); - #$wgOut->addWikiText( wfMsg( 'undeleteextrahelp' ) ); # Format the user-visible controls (comment field, submission button) # in a nice little table - $table = ''; + $table = '
'; $table .= ''; $table .= ''; $table .= ''; @@ -526,16 +534,7 @@ class UndeleteForm { $checkBox = ''; $pageLink = $wgLang->timeanddate( $ts, true ); } - $userLink = htmlspecialchars( $row->ar_user_text ); - if( $row->ar_user ) { - $userLink = $sk->makeKnownLinkObj( - Title::makeTitle( NS_USER, $row->ar_user_text ), - $userLink ); - } else { - $userLink = $sk->makeKnownLinkObj( - Title::makeTitle( NS_SPECIAL, 'Contributions' ), - $userLink, 'target=' . $row->ar_user_text ); - } + $userLink = $sk->userLink( $row->ar_user, $row->ar_user_text ); $comment = $sk->commentBlock( $row->ar_comment ); $wgOut->addHTML( "
  • $checkBox $pageLink . . $userLink $comment
  • \n" ); -- 2.20.1
    ' . wfMsgWikiHtml( 'undeleteextrahelp' ) . '
    ' . wfMsgHtml( 'undeletecomment' ) . '' . wfInput( 'wpComment', 50, $this->mComment ) . '