Cast width, height, page to int as paranoia measure

Everything is properly escaped so it doesn't matter, but as an
extra bit of safety, cast width/height/page to int, in order to
ensure under no circumstances would something unexpected be fed
to ghostscript.

Change-Id: I961a3dae5801dd116e1cb6c93808d49268d1e81e
This commit is contained in:
Brian Wolff 2016-06-13 04:56:31 -04:00
parent 335bda1e9c
commit e0ad7bd13d

View file

@ -160,9 +160,9 @@ class PdfHandler extends ImageHandler {
return new TransformParameterError( $params );
}
$width = $params['width'];
$height = $params['height'];
$page = $params['page'];
$width = (int)$params['width'];
$height = (int)$params['height'];
$page = (int)$params['page'];
if ( $page > $this->pageCount( $image ) ) {
return $this->doThumbError( $width, $height, 'pdf_page_error' );