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 );
|
$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;
|
||||||
|
|
Loading…
Reference in a new issue