if ( !isset( $images[$title] ) ) {
if ( isset( $prop['uploadwarning'] ) || isset( $prop['badfile'] ) ) {
// uploadwarning and badfile need info about non-existing files
- $images[$title] = wfLocalFile( $title );
+ $images[$title] = MediaWikiServices::getInstance()->getRepoGroup()
+ ->getLocalRepo()->newFile( $title );
// Doesn't exist, so set an empty image repository
$info['imagerepository'] = '';
} else {
// Don't set $scale['width']; this signals mergeThumbParams() to fill it with the image's width
$scale = [];
$scale['height'] = $params['urlheight'];
+ } elseif ( $params['urlparam'] ) {
+ // Audio files might not have a width/height.
+ $scale = [];
} else {
- if ( $params['urlparam'] ) {
- // Audio files might not have a width/height.
- $scale = [];
- } else {
- $scale = null;
- }
+ $scale = null;
}
return $scale;