mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/PdfHandler
synced 2024-11-27 17:50:47 +00:00
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:
parent
b253dc04c4
commit
85fbb12dbe
|
@ -81,22 +81,20 @@ class PdfImage {
|
|||
}
|
||||
$size = explode( 'x', $pageSize, 2 );
|
||||
|
||||
if ( $size ) {
|
||||
$width = intval( trim( $size[0] ) / 72 * $wgPdfHandlerDpi );
|
||||
$height = explode( ' ', trim( $size[1] ), 2 );
|
||||
$height = intval( trim( $height[0] ) / 72 * $wgPdfHandlerDpi );
|
||||
if ( ( $pageRotation / 90 ) & 1 ) {
|
||||
// Swap width and height for landscape pages
|
||||
$temp = $width;
|
||||
$width = $height;
|
||||
$height = $temp;
|
||||
}
|
||||
|
||||
return [
|
||||
'width' => $width,
|
||||
'height' => $height
|
||||
];
|
||||
$width = intval( trim( $size[0] ) / 72 * $wgPdfHandlerDpi );
|
||||
$height = explode( ' ', trim( $size[1] ), 2 );
|
||||
$height = intval( trim( $height[0] ) / 72 * $wgPdfHandlerDpi );
|
||||
if ( ( $pageRotation / 90 ) & 1 ) {
|
||||
// Swap width and height for landscape pages
|
||||
$temp = $width;
|
||||
$width = $height;
|
||||
$height = $temp;
|
||||
}
|
||||
|
||||
return [
|
||||
'width' => $width,
|
||||
'height' => $height
|
||||
];
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue