Check for an external stream first

This commit is contained in:
Leo Feyer 2018-09-11 10:35:20 +02:00
parent 7174bfea73
commit ebdfcb1cce

View File

@ -6840,6 +6840,11 @@ class TCPDF {
// image from string
$imgdata = substr($file, 1);
} else { // image file
if ($file[0] === '*') {
// image as external stream
$file = substr($file, 1);
$exurl = $file;
}
$wrappers = stream_get_wrappers();
foreach ($wrappers as $wrapper) {
if ($wrapper === 'http' || $wrapper === 'https') {
@ -6849,11 +6854,6 @@ class TCPDF {
$this->Error('Stream wrappers in file paths are not supported');
}
}
if ($file[0] === '*') {
// image as external stream
$file = substr($file, 1);
$exurl = $file;
}
// check if is a local file
if (!@file_exists($file)) {
// try to encode spaces on filename