Update 3rd party libraries
Forgot these two
This commit is contained in:
@ -70,7 +70,7 @@ class TCPDF_FONTS {
|
||||
* @public static
|
||||
*/
|
||||
public static function addTTFfont($fontfile, $fonttype='', $enc='', $flags=32, $outpath='', $platid=3, $encid=1, $addcbbox=false, $link=false) {
|
||||
if (!file_exists($fontfile)) {
|
||||
if (!TCPDF_STATIC::file_exists($fontfile)) {
|
||||
// Could not find file
|
||||
return false;
|
||||
}
|
||||
@ -95,7 +95,7 @@ class TCPDF_FONTS {
|
||||
$outpath = self::_getfontpath();
|
||||
}
|
||||
// check if this font already exist
|
||||
if (@file_exists($outpath.$font_name.'.php')) {
|
||||
if (@TCPDF_STATIC::file_exists($outpath.$font_name.'.php')) {
|
||||
// this font already exist (delete it from fonts folder to rebuild it)
|
||||
return $font_name;
|
||||
}
|
||||
@ -1543,11 +1543,11 @@ class TCPDF_FONTS {
|
||||
public static function getFontFullPath($file, $fontdir=false) {
|
||||
$fontfile = '';
|
||||
// search files on various directories
|
||||
if (($fontdir !== false) AND @file_exists($fontdir.$file)) {
|
||||
if (($fontdir !== false) AND @TCPDF_STATIC::file_exists($fontdir.$file)) {
|
||||
$fontfile = $fontdir.$file;
|
||||
} elseif (@file_exists(self::_getfontpath().$file)) {
|
||||
} elseif (@TCPDF_STATIC::file_exists(self::_getfontpath().$file)) {
|
||||
$fontfile = self::_getfontpath().$file;
|
||||
} elseif (@file_exists($file)) {
|
||||
} elseif (@TCPDF_STATIC::file_exists($file)) {
|
||||
$fontfile = $file;
|
||||
}
|
||||
return $fontfile;
|
||||
|
@ -161,12 +161,8 @@ class TCPDF_IMAGES {
|
||||
*/
|
||||
public static function _parsejpeg($file) {
|
||||
// check if is a local file
|
||||
if (!@file_exists($file)) {
|
||||
// try to encode spaces on filename
|
||||
$tfile = str_replace(' ', '%20', $file);
|
||||
if (@file_exists($tfile)) {
|
||||
$file = $tfile;
|
||||
}
|
||||
if (!@TCPDF_STATIC::file_exists($file)) {
|
||||
return false;
|
||||
}
|
||||
$a = getimagesize($file);
|
||||
if (empty($a)) {
|
||||
|
@ -55,7 +55,7 @@ class TCPDF_STATIC {
|
||||
* Current TCPDF version.
|
||||
* @private static
|
||||
*/
|
||||
private static $tcpdf_version = '6.2.17';
|
||||
private static $tcpdf_version = '6.2.22';
|
||||
|
||||
/**
|
||||
* String alias for total number of pages.
|
||||
@ -1774,39 +1774,6 @@ class TCPDF_STATIC {
|
||||
return $angle;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ====================================================================================================================
|
||||
// REIMPLEMENTED
|
||||
// ====================================================================================================================
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Split string by a regular expression.
|
||||
* This is a wrapper for the preg_split function to avoid the bug: https://bugs.php.net/bug.php?id=45850
|
||||
@ -1854,6 +1821,33 @@ class TCPDF_STATIC {
|
||||
return fopen($filename, $mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper for file_exists.
|
||||
* Checks whether a file or directory exists.
|
||||
* Only allows some protocols and local files.
|
||||
* @param filename (string) Path to the file or directory.
|
||||
* @return Returns TRUE if the file or directory specified by filename exists; FALSE otherwise.
|
||||
* @public static
|
||||
*/
|
||||
public static function file_exists($filename) {
|
||||
if (strpos($filename, '://') > 0) {
|
||||
$wrappers = stream_get_wrappers();
|
||||
foreach ($wrappers as $wrapper) {
|
||||
if (($wrapper === 'http') || ($wrapper === 'https')) {
|
||||
continue;
|
||||
}
|
||||
if (stripos($filename, $wrapper.'://') === 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!@file_exists($filename)) {
|
||||
// try to encode spaces on filename
|
||||
$filename = str_replace(' ', '%20', $filename);
|
||||
}
|
||||
return @file_exists($filename);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads entire file into a string.
|
||||
* The file can be also an URL.
|
||||
@ -1914,8 +1908,10 @@ class TCPDF_STATIC {
|
||||
}
|
||||
//
|
||||
$alt = array_unique($alt);
|
||||
//var_dump($alt);exit;//DEBUG
|
||||
foreach ($alt as $path) {
|
||||
if (!self::file_exists($path)) {
|
||||
return false;
|
||||
}
|
||||
$ret = @file_get_contents($path);
|
||||
if ($ret !== false) {
|
||||
return $ret;
|
||||
@ -1949,8 +1945,6 @@ class TCPDF_STATIC {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get ULONG from string (Big Endian 32-bit unsigned integer).
|
||||
* @param $str (string) string from where to extract value
|
||||
|
Reference in New Issue
Block a user