Merge "Fix 'Tags' padding to keep it farther from the edge and document the source...
[lhc/web/wiklou.git] / includes / specials / SpecialMIMEsearch.php
index 3290abd..f43ed9b 100644 (file)
@@ -56,8 +56,9 @@ class MIMEsearchPage extends QueryPage {
                        // Allow wildcard searching
                        $minorType['img_minor_mime'] = $this->minor;
                }
+               $imgQuery = LocalFile::getQueryInfo();
                $qi = [
-                       'tables' => [ 'image' ],
+                       'tables' => $imgQuery['tables'],
                        'fields' => [
                                'namespace' => NS_FILE,
                                'title' => 'img_name',
@@ -67,7 +68,7 @@ class MIMEsearchPage extends QueryPage {
                                'img_size',
                                'img_width',
                                'img_height',
-                               'img_user_text',
+                               'img_user_text' => $imgQuery['fields']['img_user_text'],
                                'img_timestamp'
                        ],
                        'conds' => [
@@ -89,6 +90,7 @@ class MIMEsearchPage extends QueryPage {
                                        MEDIATYPE_3D,
                                ],
                        ] + $minorType,
+                       'join_conds' => $imgQuery['joins'],
                ];
 
                return $qi;
@@ -158,7 +160,7 @@ class MIMEsearchPage extends QueryPage {
        }
 
        public function execute( $par ) {
-               $this->mime = $par ? $par : $this->getRequest()->getText( 'mime' );
+               $this->mime = $par ?: $this->getRequest()->getText( 'mime' );
                $this->mime = trim( $this->mime );
                list( $this->major, $this->minor ) = File::splitMime( $this->mime );