* (T76052) list=tags can now indicate whether a tag is defined.
* (T75522) list=prefixsearch now supports continuation
* (T78737) action=expandtemplates can now return page properties.
+* (T78690) list=allimages now accepts multiple pipe-separated values
+ for the 'aimime' parameter.
=== Action API internal changes in 1.25 ===
* ApiHelp has been rewritten to support i18n and paginated HTML output.
$this->dieUsage( 'MIME search disabled in Miser Mode', 'mimesearchdisabled' );
}
- list( $major, $minor ) = File::splitMime( $params['mime'] );
-
- $this->addWhereFld( 'img_major_mime', $major );
- $this->addWhereFld( 'img_minor_mime', $minor );
+ $mimeConds = array();
+ foreach ( $params['mime'] as $mime ) {
+ list( $major, $minor ) = File::splitMime( $mime );
+ $mimeConds[] = $db->makeList(
+ array(
+ 'img_major_mime' => $major,
+ 'img_minor_mime' => $minor,
+ ),
+ LIST_AND
+ );
+ }
+ // safeguard against internal_api_error_DBQueryError
+ if ( count( $mimeConds ) > 0 ) {
+ $this->addWhere( $db->makeList( $mimeConds, LIST_OR ) );
+ } else {
+ // no MIME types, no files
+ $this->getResult()->addValue( 'query', $this->getModuleName(), array() );
+ return;
+ }
}
$limit = $params['limit'];
),
'mime' => array(
ApiBase::PARAM_DFLT => null,
+ ApiBase::PARAM_ISMULTI => true,
),
'limit' => array(
ApiBase::PARAM_DFLT => 10,
'action=query&list=allimages&aiprop=user|timestamp|url&' .
'aisort=timestamp&aidir=older'
=> 'apihelp-query+allimages-example-recent',
+ 'action=query&list=allimages&aimime=image/png|image/gif'
+ => 'apihelp-query+allimages-example-mimetypes',
'action=query&generator=allimages&gailimit=4&' .
'gaifrom=T&prop=imageinfo'
=> 'apihelp-query+allimages-example-generator',
"apihelp-query+allimages-param-sha1base36": "SHA1 hash of image in base 36 (used in MediaWiki).",
"apihelp-query+allimages-param-user": "Only return files uploaded by this user. Can only be used with $1sort=timestamp. Cannot be used together with $1filterbots.",
"apihelp-query+allimages-param-filterbots": "How to filter files uploaded by bots. Can only be used with $1sort=timestamp. Cannot be used together with $1user.",
- "apihelp-query+allimages-param-mime": "What MIME type to search for. e.g. image/jpeg.",
+ "apihelp-query+allimages-param-mime": "What MIME types to search for, e.g. <kbd>image/jpeg</kbd>.",
"apihelp-query+allimages-param-limit": "How many images in total to return.",
"apihelp-query+allimages-example-B": "Show a list of files starting at the letter \"B\"",
"apihelp-query+allimages-example-recent": "Show a list of recently uploaded files similar to [[Special:NewFiles]]",
+ "apihelp-query+allimages-example-mimetypes": "Show a list of files with MIME type <kbd>image/png</kbd> or <kbd>image/gif</kbd>",
"apihelp-query+allimages-example-generator": "Show info about 4 files starting at the letter \"T\"",
"apihelp-query+alllinks-description": "Enumerate all links that point to a given namespace.",
"apihelp-query+allimages-param-limit": "{{doc-apihelp-param|query+allimages|limit}}",
"apihelp-query+allimages-example-B": "{{doc-apihelp-example|query+allimages}}",
"apihelp-query+allimages-example-recent": "{{doc-apihelp-example|query+allimages}}",
+ "apihelp-query+allimages-example-mimetypes": "{{doc-apihelp-example|query+allimages}}",
"apihelp-query+allimages-example-generator": "{{doc-apihelp-example|query+allimages}}",
"apihelp-query+alllinks-description": "{{doc-apihelp-description|query+alllinks}}",
"apihelp-query+alllinks-param-from": "{{doc-apihelp-param|query+alllinks|from}}",