From 63601400e476c6cf43d985f3e7b9864681695ed4 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 18 Jan 2013 16:46:04 +0100 Subject: Update to MediaWiki 1.20.2 this update includes: * adjusted Arch Linux skin * updated FluxBBAuthPlugin * patch for https://bugzilla.wikimedia.org/show_bug.cgi?id=44024 --- includes/specials/SpecialFileDuplicateSearch.php | 30 +++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'includes/specials/SpecialFileDuplicateSearch.php') diff --git a/includes/specials/SpecialFileDuplicateSearch.php b/includes/specials/SpecialFileDuplicateSearch.php index 18d19db8..ccf8ba17 100644 --- a/includes/specials/SpecialFileDuplicateSearch.php +++ b/includes/specials/SpecialFileDuplicateSearch.php @@ -78,8 +78,8 @@ class FileDuplicateSearchPage extends QueryPage { return array( 'tables' => array( 'image' ), 'fields' => array( - 'img_name AS title', - 'img_sha1 AS value', + 'title' => 'img_name', + 'value' => 'img_sha1', 'img_user_text', 'img_timestamp' ), @@ -157,10 +157,24 @@ class FileDuplicateSearchPage extends QueryPage { ); } + $this->doBatchLookups( $dupes ); $this->showList( $dupes ); } } + function doBatchLookups( $list ) { + $batch = new LinkBatch(); + foreach( $list as $file ) { + $batch->addObj( $file->getTitle() ); + if( $file->isLocal() ) { + $userName = $file->getUser( 'text' ); + $batch->add( NS_USER, $userName ); + $batch->add( NS_USER_TALK, $userName ); + } + } + $batch->execute(); + } + /** * * @param Skin $skin @@ -178,7 +192,17 @@ class FileDuplicateSearchPage extends QueryPage { ); $userText = $result->getUser( 'text' ); - $user = Linker::link( Title::makeTitle( NS_USER, $userText ), $userText ); + if ( $result->isLocal() ) { + $userId = $result->getUser( 'id' ); + $user = Linker::userLink( $userId, $userText ); + $user .= $this->getContext()->msg( 'word-separator' )->plain(); + $user .= ''; + $user .= Linker::userToolLinks( $userId, $userText ); + $user .= ''; + } else { + $user = htmlspecialchars( $userText ); + } + $time = $this->getLanguage()->userTimeAndDate( $result->getTimestamp(), $this->getUser() ); return "$plink . . $user . . $time"; -- cgit v1.2.3-54-g00ecf