mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/PdfHandler
synced 2024-11-24 00:07:10 +00:00
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:
parent
335bda1e9c
commit
e0ad7bd13d
|
@ -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' );
|
||||
|
|
Loading…
Reference in a new issue