}
public function getQueryInfo() {
+ $minorType = array();
+ if ( $this->minor !== '*' ) {
+ // Allow wildcard searching
+ $minorType['img_minor_mime'] = $this->minor;
+ }
$qi = array(
'tables' => array( 'image' ),
'fields' => array(
),
'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(
MEDIATYPE_EXECUTABLE,
MEDIATYPE_ARCHIVE,
),
- ),
+ ) + $minorType,
);
return $qi;
}
function execute( $par ) {
- global $wgScript;
-
$mime = $par ? $par : $this->getRequest()->getText( 'mime' );
$mime = trim( $mime );
$this->getOutput()->addHTML(
Xml::openElement(
'form',
- array( 'id' => 'specialmimesearch', 'method' => 'get', 'action' => $wgScript )
+ array( 'id' => 'specialmimesearch', 'method' => 'get', 'action' => wfScript() )
) .
Xml::openElement( 'fieldset' ) .
Html::hidden( 'title', $this->getPageTitle()->getPrefixedText() ) .