From a2469d8354a70231537d3ee2f9a17ad5f16637be Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 19 Sep 2019 13:32:52 +0200 Subject: fix undefined property using patch from https://github.com/tecnickcom/TCPDF/pull/136 --- ...-fix-Undefined-property-GLPIPDF-imagekeys.patch | 29 ++++++++++++++++++++++ php-tcpdf.spec | 5 ++++ 2 files changed, 34 insertions(+) create mode 100644 0001-fix-Undefined-property-GLPIPDF-imagekeys.patch diff --git a/0001-fix-Undefined-property-GLPIPDF-imagekeys.patch b/0001-fix-Undefined-property-GLPIPDF-imagekeys.patch new file mode 100644 index 0000000..07a91f6 --- /dev/null +++ b/0001-fix-Undefined-property-GLPIPDF-imagekeys.patch @@ -0,0 +1,29 @@ +From aeb25939d50249a7de4a8ff5d9d8121b41084678 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Thu, 19 Sep 2019 13:14:28 +0200 +Subject: [PATCH] fix Undefined property: GLPIPDF::$imagekeys + +--- + tcpdf.php | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/tcpdf.php b/tcpdf.php +index 8238784..d1cf110 100644 +--- a/tcpdf.php ++++ b/tcpdf.php +@@ -7796,8 +7796,10 @@ class TCPDF { + } + closedir($handle); + } +- foreach($this->imagekeys as $file) { +- unlink($file); ++ if (isset($this->imagekeys)) { ++ foreach($this->imagekeys as $file) { ++ unlink($file); ++ } + } + } + $preserve = array( +-- +2.20.1 + diff --git a/php-tcpdf.spec b/php-tcpdf.spec index f538438..868a118 100644 --- a/php-tcpdf.spec +++ b/php-tcpdf.spec @@ -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: 0001-fix-Undefined-property-GLPIPDF-imagekeys.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 : Fix versiohn sed -e 's/6.2.26/%{version}/' -i include/tcpdf_static.php @@ -321,6 +324,8 @@ php -r 'require "%{buildroot}%{_datadir}/php/%{real_name}/autoload.php"; - drop patch merged upstream - add weak dependency on imagick extension - open https://github.com/tecnickcom/TCPDF/pull/135 fix version +- fix undefined property using patch from + https://github.com/tecnickcom/TCPDF/pull/136 * Fri Sep 13 2019 Remi Collet - 6.2.26-4 - add patch for 7.4 from -- cgit