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.
This commit is contained in:
Taco van den Broek 2017-06-14 16:23:31 +02:00
parent 95c5938aaf
commit 3a1950ba8a

View File

@ -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);