mirror of
https://github.com/tecnickcom/TCPDF.git
synced 2025-03-24 07:59:55 +01:00
Check for an external stream first
This commit is contained in:
parent
7174bfea73
commit
ebdfcb1cce
10
tcpdf.php
10
tcpdf.php
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user