mpdf 将无法打开 allow_url_fopen 设置为开的图像

mpdf will not open image with allow_url_fopen set to On

使用 PHP 库 mPDF 我得到错误

could not find image file

在 html 中查找 jpg 时。

当 allow_url_fopen 设置为关闭时不会发生这种情况,但我需要打开该设置。

我设法更改了 mpdf.php 中的检查,检查 allow_url_fopen 是否关闭,如果关闭则不使用 cURL。我更改了代码

if ((!$data || !$type) && !ini_get('allow_url_fopen') && function_exists("curl_init")) {
    $this->file_get_contents_by_curl($file, $data);     // needs full url?? even on local (never needed for local)
    if ($data) { $type = $this->_imageTypeFromString($data); }
} 

if ((!$data || !$type) && ini_get('allow_url_fopen') && function_exists("curl_init")) {
    $this->file_get_contents_by_curl($file, $data);     // needs full url?? even on local (never needed for local)
    if ($data) { $type = $this->_imageTypeFromString($data); }
}