X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialMIMEsearch.php;h=4d9e7dad7f6550761782ad2509227a1b90d8924c;hb=8187075a7f5eec32437a69045c96fa18da979a95;hp=50af9159d95332d647d4867b96002893dc8fbff8;hpb=214a19f5ed0de0496ff82013e28ef9004c07f723;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialMIMEsearch.php b/includes/specials/SpecialMIMEsearch.php index 50af9159d9..4d9e7dad7f 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( @@ -82,7 +86,7 @@ class MIMEsearchPage extends QueryPage { MEDIATYPE_EXECUTABLE, MEDIATYPE_ARCHIVE, ), - ), + ) + $minorType, ); return $qi; @@ -104,6 +108,7 @@ class MIMEsearchPage extends QueryPage { global $wgScript; $mime = $par ? $par : $this->getRequest()->getText( 'mime' ); + $mime = trim( $mime ); $this->setHeaders(); $this->outputHeader(); @@ -166,7 +171,7 @@ class MIMEsearchPage extends QueryPage { } /** - * @param $type string + * @param string $type * @return bool */ protected static function isValidType( $type ) {