dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Do a last check before creating the object to not throw a fatal error when calling...
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiMain.php
diff --git
a/includes/api/ApiMain.php
b/includes/api/ApiMain.php
index
1fc65f3
..
35c1426
100644
(file)
--- a/
includes/api/ApiMain.php
+++ b/
includes/api/ApiMain.php
@@
-228,6
+228,8
@@
class ApiMain extends ApiBase {
* Create an instance of an output formatter by its name
*/
public function createPrinterByName($format) {
* Create an instance of an output formatter by its name
*/
public function createPrinterByName($format) {
+ if( !isset( $this->mFormats[$format] ) )
+ $this->dieUsage( "Unrecognized format: {$format}", 'unknown_format' );
return new $this->mFormats[$format] ($this, $format);
}
return new $this->mFormats[$format] ($this, $format);
}