mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-11-15 03:35:53 +00:00
PortableInfoboxImagesHelper: Return empty array instead of false in extendImageData
Because we use array_merge, the value returned has to be an array, not a boolean. error message: ```ErrorException from line 166 of /srv/mediawiki/w/extensions/PortableInfobox/includes/services/Parser/Nodes/NodeMedia.php: PHP Warning: array_merge(): Expected parameter 2 to be an array, bool given```
This commit is contained in:
parent
a5fd349880
commit
7601979bfe
|
@ -19,7 +19,7 @@ class PortableInfoboxImagesHelper {
|
|||
$file = $this->getFile( $file );
|
||||
|
||||
if ( !$file || !in_array( $file->getMediaType(), [ MEDIATYPE_BITMAP, MEDIATYPE_DRAWING ] ) ) {
|
||||
return false;
|
||||
return [];
|
||||
}
|
||||
|
||||
// get dimensions
|
||||
|
@ -53,7 +53,7 @@ class PortableInfoboxImagesHelper {
|
|||
'height' => round( $fileDimensions['height'] * $ratio * 2 ),
|
||||
] );
|
||||
if ( !$thumbnail || $thumbnail->isError() || !$thumbnail2x || $thumbnail2x->isError() ) {
|
||||
return false;
|
||||
return [];
|
||||
}
|
||||
|
||||
return [
|
||||
|
|
Loading…
Reference in a new issue