From c93baa941a5a56b7699fcb3e2dab749a5e089459 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Mon, 9 Jun 2014 02:05:17 -0300 Subject: [PATCH] Allow using wildcards for minor type in Special:MIMESearch e.g. Allow [[Special:MIMESearch/application/*]]. Change-Id: Ic098b10a64e3346d58c94f2dbfbb552dd809e93d --- includes/specials/SpecialMIMEsearch.php | 8 ++++++-- languages/i18n/en.json | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/includes/specials/SpecialMIMEsearch.php b/includes/specials/SpecialMIMEsearch.php index a2ae2106fa..cb9dac9bfa 100644 --- a/includes/specials/SpecialMIMEsearch.php +++ b/includes/specials/SpecialMIMEsearch.php @@ -51,6 +51,11 @@ class MIMEsearchPage extends QueryPage { } public function getQueryInfo() { + $minorType = array(); + if ( $this->minor !== '*' ) { + // Allow wildcard searching + $minorType['img_minor_mime'] = $this->minor; + } $qi = array( 'tables' => array( 'image' ), 'fields' => array( @@ -67,7 +72,6 @@ class MIMEsearchPage extends QueryPage { ), 'conds' => array( 'img_major_mime' => $this->major, - 'img_minor_mime' => $this->minor, // This is in order to trigger using // the img_media_mime index in "range" mode. 'img_media_type' => array( @@ -81,7 +85,7 @@ class MIMEsearchPage extends QueryPage { MEDIATYPE_TEXT, MEDIATYPE_EXECUTABLE, MEDIATYPE_ARCHIVE, - ), + ) + $minorType, ), ); diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 14b6b66da3..5d8cd9a990 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -1506,7 +1506,7 @@ "filedelete-maintenance": "Deletion and restoration of files temporarily disabled during maintenance.", "filedelete-maintenance-title": "Cannot delete file", "mimesearch": "MIME search", - "mimesearch-summary": "This page enables the filtering of files for their MIME type.\nInput: contenttype/subtype, e.g. image/jpeg.", + "mimesearch-summary": "This page enables the filtering of files for their MIME type.\nInput: contenttype/subtype or contenttype/*, e.g. image/jpeg.", "mimetype": "MIME type:", "download": "download", "unwatchedpages": "Unwatched pages", -- 2.20.1