summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialFileDuplicateSearch.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/specials/SpecialFileDuplicateSearch.php')
-rw-r--r--includes/specials/SpecialFileDuplicateSearch.php30
1 files changed, 27 insertions, 3 deletions
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 .= '<span style="white-space: nowrap;">';
+ $user .= Linker::userToolLinks( $userId, $userText );
+ $user .= '</span>';
+ } else {
+ $user = htmlspecialchars( $userText );
+ }
+
$time = $this->getLanguage()->userTimeAndDate( $result->getTimestamp(), $this->getUser() );
return "$plink . . $user . . $time";