Fix image file type for urls with query params (#287)

Co-authored-by: Nicola Asuni <nicolaasuni@users.noreply.github.com>
This commit is contained in:
Roy Van Ginneken 2021-03-27 10:17:09 +01:00 committed by GitHub
parent 0fb31c9ddd
commit 869ab2651b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,10 +77,7 @@ class TCPDF_IMAGES {
}
}
if (empty($type)) {
$fileinfo = pathinfo($imgfile);
if (isset($fileinfo['extension']) AND (!TCPDF_STATIC::empty_string($fileinfo['extension']))) {
$type = strtolower(trim($fileinfo['extension']));
}
$type = strtolower(trim(pathinfo(parse_url($imgfile, PHP_URL_PATH), PATHINFO_EXTENSION)));
}
if ($type == 'jpg') {
$type = 'jpeg';