From 6b3221054f7bf94d637ef7175879196462ac024e Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Wed, 16 Mar 2011 18:23:04 +0000 Subject: [PATCH] (follow-up r65035/r65013) The username parameter wasn't preserved when clicking links in Special:Listfiles. --- RELEASE-NOTES | 1 + includes/specials/SpecialListfiles.php | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 576edb0852..649c444450 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -193,6 +193,7 @@ PHP if you have not done so prior to upgrading MediaWiki. for "ABORTED" reason to be returned and displayed to user. * (bug 28034) uploading file to local wiki when file exists on shared repository (commons) gives spurious info in the warning message +* Usernames get lost when selecting different sorts on Special:listfiles === API changes in 1.18 === * (bug 26339) Throw warning when truncating an overlarge API result diff --git a/includes/specials/SpecialListfiles.php b/includes/specials/SpecialListfiles.php index 49eb60a92c..a6bc714cbe 100644 --- a/includes/specials/SpecialListfiles.php +++ b/includes/specials/SpecialListfiles.php @@ -238,9 +238,19 @@ class ImageListPager extends TablePager { if ( !is_null( $this->mUserName ) ) { # Append the username to the query string foreach ( $queries as &$query ) { - $query['username'] = $this->mUserName; + $query['user'] = $this->mUserName; } } return $queries; } + + function getDefaultQuery() { + $queries = parent::getDefaultQuery(); + if ( !isset( $queries['user'] ) + && !is_null( $this->mUserName ) ) + { + $queries['user'] = $this->mUserName; + } + return $queries; + } } -- 2.20.1