mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 11:08:45 +02:00
N°2329 Update TCPDF to version fixing unlink bug
Was updated to 6.3.2 fot PHP 7.4 compat, but this version had a regression (issue 159 in the original repo) This commit integrates 6.3.4 that includes a fix for issue 159
This commit is contained in:
@@ -629,7 +629,7 @@ class Datamatrix {
|
||||
if ($numch[ENC_C40] == $numch[ENC_X12]) {
|
||||
$k = ($pos + $charscount + 1);
|
||||
while ($k < $data_length) {
|
||||
$tmpchr = ord($data{$k});
|
||||
$tmpchr = ord($data[$k]);
|
||||
if ($this->isCharMode($tmpchr, ENC_X12)) {
|
||||
return ENC_X12;
|
||||
} elseif (!($this->isCharMode($tmpchr, ENC_X12) OR $this->isCharMode($tmpchr, ENC_C40))) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
//============================================================+
|
||||
// File name : tcpdf_static.php
|
||||
// Version : 1.1.3
|
||||
// Version : 1.1.4
|
||||
// Begin : 2002-08-03
|
||||
// Last Update : 2015-04-28
|
||||
// Last Update : 2019-11-01
|
||||
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
|
||||
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||
// -------------------------------------------------------------------
|
||||
@@ -55,7 +55,7 @@ class TCPDF_STATIC {
|
||||
* Current TCPDF version.
|
||||
* @private static
|
||||
*/
|
||||
private static $tcpdf_version = '6.3.2';
|
||||
private static $tcpdf_version = '6.3.4';
|
||||
|
||||
/**
|
||||
* String alias for total number of pages.
|
||||
@@ -1829,6 +1829,8 @@ class TCPDF_STATIC {
|
||||
*/
|
||||
public static function url_exists($url) {
|
||||
$crs = curl_init();
|
||||
// encode query params in URL to get right response form the server
|
||||
$url = self::encodeUrlQuery($url);
|
||||
curl_setopt($crs, CURLOPT_URL, $url);
|
||||
curl_setopt($crs, CURLOPT_NOBODY, true);
|
||||
curl_setopt($crs, CURLOPT_FAILONERROR, true);
|
||||
@@ -1846,6 +1848,26 @@ class TCPDF_STATIC {
|
||||
return ($code == 200);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode query params in URL
|
||||
*
|
||||
* @param string $url
|
||||
* @return string
|
||||
* @since 6.3.3 (2019-11-01)
|
||||
* @public static
|
||||
*/
|
||||
public static function encodeUrlQuery($url) {
|
||||
$urlData = parse_url($url);
|
||||
if (isset($urlData['query']) && $urlData['query']) {
|
||||
$urlQueryData = [];
|
||||
parse_str(urldecode($urlData['query']), $urlQueryData);
|
||||
$updatedUrl = $urlData['scheme'] . '://' . $urlData['host'] . $urlData['path'] . '?' . http_build_query($urlQueryData);
|
||||
} else {
|
||||
$updatedUrl = $url;
|
||||
}
|
||||
return $updatedUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper for file_exists.
|
||||
* Checks whether a file or directory exists.
|
||||
|
||||
Reference in New Issue
Block a user