From 3a1950ba8a9e9bf7a5c9e12f102fc211a0b5047a Mon Sep 17 00:00:00 2001 From: Taco van den Broek Date: Wed, 14 Jun 2017 16:23:31 +0200 Subject: [PATCH] Add url as an alternative path instead of returning directly When TCPDF_STATIC::fileGetContents is called with a relative path while $_SERVER['SCRIPT_URI'] is set, this method _always_ used the web-url to retrieve the contents. --- include/tcpdf_static.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/tcpdf_static.php b/include/tcpdf_static.php index 16353e0..5f70670 100644 --- a/include/tcpdf_static.php +++ b/include/tcpdf_static.php @@ -1910,7 +1910,7 @@ class TCPDF_STATIC { && !preg_match('%^//%', $file) ) { $urldata = @parse_url($_SERVER['SCRIPT_URI']); - return $urldata['scheme'].'://'.$urldata['host'].(($file[0] == '/') ? '' : '/').$file; + $alt[] = $urldata['scheme'].'://'.$urldata['host'].(($file[0] == '/') ? '' : '/').$file; } // $alt = array_unique($alt);