diff options
| -rw-r--r-- | 7dbdfa405123c2fbca4864d87a143f7977403767.patch | 36 | ||||
| -rw-r--r-- | php-tcpdf.spec | 11 | 
2 files changed, 45 insertions, 2 deletions
diff --git a/7dbdfa405123c2fbca4864d87a143f7977403767.patch b/7dbdfa405123c2fbca4864d87a143f7977403767.patch new file mode 100644 index 0000000..b422e37 --- /dev/null +++ b/7dbdfa405123c2fbca4864d87a143f7977403767.patch @@ -0,0 +1,36 @@ +From 7dbdfa405123c2fbca4864d87a143f7977403767 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Vojta=20Mat=C4=9Bjka?= <woytam@users.noreply.github.com> +Date: Sun, 20 Oct 2019 15:30:04 +0200 +Subject: [PATCH] Problem with imagekeys undefined or unlinked + +PR #136 removed problem with undefined `$imagekeys`, but the solution skipped cleaning files in `$imagekeys`. +The problem about this is that `_destroy` function is called 3 times (from `Close` function, as `shutdown_handler` and from `__desctruct` function). Only first time is called as `destroyall == false`, but unset `$imagekeys`. My solution is to preserve `$imagekeys` to be cleaned by call with `$imagekeys == true`. +--- + tcpdf.php | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/tcpdf.php b/tcpdf.php +index 0ee30bc0..a38edfcc 100644 +--- a/tcpdf.php ++++ b/tcpdf.php +@@ -7796,10 +7796,8 @@ public function _destroy($destroyall=false, $preserve_objcopy=false) { + 				} + 				closedir($handle); + 			} +-			if (isset($this->imagekeys)) { +-				foreach($this->imagekeys as $file) { +-					unlink($file); +-				} ++			foreach($this->imagekeys as $file) { ++				unlink($file); + 			} + 		} + 		$preserve = array( +@@ -7809,6 +7807,7 @@ public function _destroy($destroyall=false, $preserve_objcopy=false) { + 			'bufferlen', + 			'buffer', + 			'cached_files', ++			'imagekeys', + 			'sign', + 			'signature_data', + 			'signature_max_length', diff --git a/php-tcpdf.spec b/php-tcpdf.spec index 87bf8d2..537aac7 100644 --- a/php-tcpdf.spec +++ b/php-tcpdf.spec @@ -7,7 +7,7 @@  # Please, preserve the changelog entries  #  # see https://github.com/tecnickcom/TCPDF/releases -%global gh_commit    9fde7bb9b404b945e7ea88fb7eccd23d9a4e324b +%global gh_commit    185eb13f216179b3107d51f954059f33ff1b1cf3  %global gh_short     %(c=%{gh_commit}; echo ${c:0:7})  %global gh_owner     tecnickcom  %global gh_project   TCPDF @@ -15,7 +15,7 @@  Name:           php-tcpdf  Summary:        PHP class for generating PDF documents and barcodes -Version:        6.3.2 +Version:        6.3.3  Release:        1%{?dist}  URL:            http://www.tcpdf.org @@ -25,6 +25,8 @@ Source0:        https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit  # Disable opcache cahing for font metadata which may consume up to 90MB  Source1:        %{name}.blacklist +Patch0:         https://github.com/tecnickcom/TCPDF/commit/7dbdfa405123c2fbca4864d87a143f7977403767.patch +  BuildArch:      noarch  BuildRequires:  php-cli  BuildRequires:  php-fedora-autoloader-devel @@ -199,6 +201,7 @@ This package allow to use system GNU FreeFont serif font faces in TCPDF.  %prep  %setup -q -n %{gh_project}-%{gh_commit} +%patch0 -p1 -R  : remove bundled fonts  rm -rf fonts/dejavu-fonts-ttf* fonts/freefont-* fonts/ae_fonts_* @@ -313,6 +316,10 @@ php -r 'require "%{buildroot}%{_datadir}/php/%{real_name}/autoload.php";  %changelog +* Wed Feb 12 2020 Remi Collet <remi@remirepo.net> - 6.3.3-1 +- update to 6.3.3 +- revert 1 upstream commit breaking 7.4 +  * Fri Sep 20 2019 Remi Collet <remi@remirepo.net> - 6.3.2-1  - update to 6.3.2  | 
