Remove unneeded check for return value of explode

explode returns an array with one item,
but the empty string is already checked before the explode

Change-Id: I441309978b25754bad04eeba69993913de4d48c3
This commit is contained in:
Umherirrender 2021-09-19 02:33:35 +02:00
parent b253dc04c4
commit 85fbb12dbe

View file

@ -81,22 +81,20 @@ class PdfImage {
} }
$size = explode( 'x', $pageSize, 2 ); $size = explode( 'x', $pageSize, 2 );
if ( $size ) { $width = intval( trim( $size[0] ) / 72 * $wgPdfHandlerDpi );
$width = intval( trim( $size[0] ) / 72 * $wgPdfHandlerDpi ); $height = explode( ' ', trim( $size[1] ), 2 );
$height = explode( ' ', trim( $size[1] ), 2 ); $height = intval( trim( $height[0] ) / 72 * $wgPdfHandlerDpi );
$height = intval( trim( $height[0] ) / 72 * $wgPdfHandlerDpi ); if ( ( $pageRotation / 90 ) & 1 ) {
if ( ( $pageRotation / 90 ) & 1 ) { // Swap width and height for landscape pages
// Swap width and height for landscape pages $temp = $width;
$temp = $width; $width = $height;
$width = $height; $height = $temp;
$height = $temp;
}
return [
'width' => $width,
'height' => $height
];
} }
return [
'width' => $width,
'height' => $height
];
} }
return false; return false;