From 8b7d734c47129ad9d41544b9820d6ff4a1ba7f57 Mon Sep 17 00:00:00 2001 From: Clifford Paulick Date: Wed, 10 Jun 2020 09:22:51 -0500 Subject: [PATCH 1/3] mPDF 8+ to 8.0.4+ --- composer.json | 2 +- composer.lock | 75 ++-- vendor/autoload.php | 2 +- vendor/composer/ClassLoader.php | 8 +- vendor/composer/autoload_classmap.php | 5 +- vendor/composer/autoload_real.php | 17 +- vendor/composer/autoload_static.php | 13 +- vendor/composer/installed.json | 242 +++++++------ vendor/mpdf/mpdf/.github/FUNDING.yml | 1 + vendor/mpdf/mpdf/.travis.yml | 13 +- vendor/mpdf/mpdf/CHANGELOG.md | 28 ++ vendor/mpdf/mpdf/README.md | 19 +- vendor/mpdf/mpdf/composer.json | 9 +- vendor/mpdf/mpdf/ruleset.xml | 46 +-- vendor/mpdf/mpdf/src/Barcode.php | 3 + vendor/mpdf/mpdf/src/Barcode/Code128.php | 38 +- vendor/mpdf/mpdf/src/Barcode/Code93.php | 14 +- vendor/mpdf/mpdf/src/Barcode/EanExt.php | 4 +- vendor/mpdf/mpdf/src/Barcode/EanUpc.php | 8 +- vendor/mpdf/mpdf/src/Barcode/Imb.php | 4 +- vendor/mpdf/mpdf/src/Cache.php | 6 +- vendor/mpdf/mpdf/src/Color/ColorConverter.php | 60 ++-- .../mpdf/src/Color/ColorModeConverter.php | 1 + .../mpdf/src/Color/ColorSpaceRestrictor.php | 6 +- .../mpdf/mpdf/src/Config/ConfigVariables.php | 8 + .../mpdf/mpdf/src/Conversion/DecToOther.php | 1 + vendor/mpdf/mpdf/src/CssManager.php | 69 +++- .../mpdf/mpdf/src/Exception/FontException.php | 8 + .../mpdf/src/File/StreamWrapperChecker.php | 46 +++ vendor/mpdf/mpdf/src/Fonts/FontCache.php | 4 +- vendor/mpdf/mpdf/src/Form.php | 26 +- vendor/mpdf/mpdf/src/FpdiTrait.php | 151 +++++++- vendor/mpdf/mpdf/src/Gif/ImageHeader.php | 2 +- vendor/mpdf/mpdf/src/Gradient.php | 30 +- vendor/mpdf/mpdf/src/Image/ImageProcessor.php | 50 +-- vendor/mpdf/mpdf/src/Image/Svg.php | 212 +++++------ vendor/mpdf/mpdf/src/Image/Wmf.php | 2 +- vendor/mpdf/mpdf/src/Mpdf.php | 329 +++++++++++++----- vendor/mpdf/mpdf/src/Otl.php | 16 +- vendor/mpdf/mpdf/src/OtlDump.php | 64 ++-- vendor/mpdf/mpdf/src/Pdf/Protection.php | 6 +- vendor/mpdf/mpdf/src/RemoteContentFetcher.php | 24 +- vendor/mpdf/mpdf/src/Shaper/Indic.php | 34 +- vendor/mpdf/mpdf/src/Shaper/Myanmar.php | 6 +- vendor/mpdf/mpdf/src/Shaper/Sea.php | 2 +- vendor/mpdf/mpdf/src/TTFontFile.php | 86 ++--- vendor/mpdf/mpdf/src/TTFontFileAnalysis.php | 24 +- vendor/mpdf/mpdf/src/TableOfContents.php | 20 +- vendor/mpdf/mpdf/src/Tag/BarCode.php | 4 +- vendor/mpdf/mpdf/src/Tag/BlockTag.php | 28 +- vendor/mpdf/mpdf/src/Tag/Columns.php | 2 +- vendor/mpdf/mpdf/src/Tag/Hr.php | 4 +- vendor/mpdf/mpdf/src/Tag/Img.php | 2 +- vendor/mpdf/mpdf/src/Tag/Input.php | 8 +- vendor/mpdf/mpdf/src/Tag/Meter.php | 16 +- vendor/mpdf/mpdf/src/Tag/Table.php | 9 +- vendor/mpdf/mpdf/src/Tag/Tag.php | 6 + vendor/mpdf/mpdf/src/Tag/Td.php | 22 +- vendor/mpdf/mpdf/src/Tag/TextArea.php | 6 +- vendor/mpdf/mpdf/src/Utils/Arrays.php | 72 ++++ .../mpdf/mpdf/src/Writer/MetadataWriter.php | 36 +- vendor/myclabs/deep-copy/.gitattributes | 7 - vendor/myclabs/deep-copy/.github/FUNDING.yml | 12 + vendor/myclabs/deep-copy/.gitignore | 3 - vendor/myclabs/deep-copy/.scrutinizer.yml | 4 - vendor/myclabs/deep-copy/.travis.yml | 40 --- vendor/myclabs/deep-copy/README.md | 9 +- vendor/myclabs/deep-copy/fixtures/f001/A.php | 20 -- vendor/myclabs/deep-copy/fixtures/f001/B.php | 20 -- vendor/myclabs/deep-copy/fixtures/f002/A.php | 33 -- .../myclabs/deep-copy/fixtures/f003/Foo.php | 26 -- .../fixtures/f004/UnclonableItem.php | 13 - .../myclabs/deep-copy/fixtures/f005/Foo.php | 13 - vendor/myclabs/deep-copy/fixtures/f006/A.php | 26 -- vendor/myclabs/deep-copy/fixtures/f006/B.php | 26 -- .../fixtures/f007/FooDateInterval.php | 15 - .../fixtures/f007/FooDateTimeZone.php | 15 - vendor/myclabs/deep-copy/fixtures/f008/A.php | 18 - vendor/myclabs/deep-copy/fixtures/f008/B.php | 7 - .../deep-copy/src/DeepCopy/DeepCopy.php | 19 +- .../TypeFilter/Spl/ArrayObjectFilter.php | 36 ++ vendor/psr/log/.gitignore | 1 - vendor/psr/log/Psr/Log/LoggerInterface.php | 40 ++- vendor/psr/log/Psr/Log/LoggerTrait.php | 2 + vendor/psr/log/Psr/Log/NullLogger.php | 2 + vendor/psr/log/Psr/Log/Test/DummyTest.php | 18 + .../log/Psr/Log/Test/LoggerInterfaceTest.php | 10 +- vendor/psr/log/Psr/Log/Test/TestLogger.php | 1 + vendor/psr/log/README.md | 6 + vendor/psr/log/composer.json | 2 +- vendor/setasign/fpdi/LICENSE.txt | 2 +- vendor/setasign/fpdi/README.md | 54 +-- vendor/setasign/fpdi/SECURITY.md | 5 + vendor/setasign/fpdi/composer.json | 10 +- vendor/setasign/fpdi/src/FpdfTpl.php | 2 +- vendor/setasign/fpdi/src/FpdfTplTrait.php | 2 +- vendor/setasign/fpdi/src/Fpdi.php | 4 +- vendor/setasign/fpdi/src/FpdiException.php | 2 +- vendor/setasign/fpdi/src/FpdiTrait.php | 2 +- .../CrossReference/AbstractReader.php | 2 +- .../CrossReference/CrossReference.php | 14 +- .../CrossReferenceException.php | 2 +- .../PdfParser/CrossReference/FixedReader.php | 2 +- .../PdfParser/CrossReference/LineReader.php | 2 +- .../CrossReference/ReaderInterface.php | 2 +- .../fpdi/src/PdfParser/Filter/Ascii85.php | 9 +- .../src/PdfParser/Filter/Ascii85Exception.php | 2 +- .../fpdi/src/PdfParser/Filter/AsciiHex.php | 2 +- .../src/PdfParser/Filter/FilterException.php | 2 +- .../src/PdfParser/Filter/FilterInterface.php | 2 +- .../fpdi/src/PdfParser/Filter/Flate.php | 33 +- .../src/PdfParser/Filter/FlateException.php | 2 +- .../fpdi/src/PdfParser/Filter/Lzw.php | 2 +- .../src/PdfParser/Filter/LzwException.php | 2 +- .../setasign/fpdi/src/PdfParser/PdfParser.php | 2 +- .../fpdi/src/PdfParser/PdfParserException.php | 2 +- .../fpdi/src/PdfParser/StreamReader.php | 2 +- .../setasign/fpdi/src/PdfParser/Tokenizer.php | 2 +- .../fpdi/src/PdfParser/Type/PdfArray.php | 2 +- .../fpdi/src/PdfParser/Type/PdfBoolean.php | 2 +- .../fpdi/src/PdfParser/Type/PdfDictionary.php | 2 +- .../fpdi/src/PdfParser/Type/PdfHexString.php | 2 +- .../src/PdfParser/Type/PdfIndirectObject.php | 2 +- .../Type/PdfIndirectObjectReference.php | 2 +- .../fpdi/src/PdfParser/Type/PdfName.php | 6 +- .../fpdi/src/PdfParser/Type/PdfNull.php | 2 +- .../fpdi/src/PdfParser/Type/PdfNumeric.php | 2 +- .../fpdi/src/PdfParser/Type/PdfStream.php | 9 +- .../fpdi/src/PdfParser/Type/PdfString.php | 2 +- .../fpdi/src/PdfParser/Type/PdfToken.php | 2 +- .../fpdi/src/PdfParser/Type/PdfType.php | 2 +- .../src/PdfParser/Type/PdfTypeException.php | 2 +- .../src/PdfReader/DataStructure/Rectangle.php | 2 +- vendor/setasign/fpdi/src/PdfReader/Page.php | 2 +- .../fpdi/src/PdfReader/PageBoundaries.php | 2 +- .../setasign/fpdi/src/PdfReader/PdfReader.php | 31 +- .../fpdi/src/PdfReader/PdfReaderException.php | 2 +- vendor/setasign/fpdi/src/Tcpdf/Fpdi.php | 2 +- vendor/setasign/fpdi/src/TcpdfFpdi.php | 2 +- vendor/setasign/fpdi/src/Tfpdf/FpdfTpl.php | 79 +---- vendor/setasign/fpdi/src/Tfpdf/Fpdi.php | 26 +- vendor/setasign/fpdi/src/autoload.php | 2 +- 142 files changed, 1610 insertions(+), 1253 deletions(-) create mode 100644 vendor/mpdf/mpdf/.github/FUNDING.yml create mode 100644 vendor/mpdf/mpdf/src/Exception/FontException.php create mode 100644 vendor/mpdf/mpdf/src/File/StreamWrapperChecker.php delete mode 100755 vendor/myclabs/deep-copy/.gitattributes create mode 100644 vendor/myclabs/deep-copy/.github/FUNDING.yml delete mode 100755 vendor/myclabs/deep-copy/.gitignore delete mode 100644 vendor/myclabs/deep-copy/.scrutinizer.yml delete mode 100755 vendor/myclabs/deep-copy/.travis.yml delete mode 100644 vendor/myclabs/deep-copy/fixtures/f001/A.php delete mode 100644 vendor/myclabs/deep-copy/fixtures/f001/B.php delete mode 100644 vendor/myclabs/deep-copy/fixtures/f002/A.php delete mode 100644 vendor/myclabs/deep-copy/fixtures/f003/Foo.php delete mode 100644 vendor/myclabs/deep-copy/fixtures/f004/UnclonableItem.php delete mode 100644 vendor/myclabs/deep-copy/fixtures/f005/Foo.php delete mode 100644 vendor/myclabs/deep-copy/fixtures/f006/A.php delete mode 100644 vendor/myclabs/deep-copy/fixtures/f006/B.php delete mode 100644 vendor/myclabs/deep-copy/fixtures/f007/FooDateInterval.php delete mode 100644 vendor/myclabs/deep-copy/fixtures/f007/FooDateTimeZone.php delete mode 100644 vendor/myclabs/deep-copy/fixtures/f008/A.php delete mode 100644 vendor/myclabs/deep-copy/fixtures/f008/B.php create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/ArrayObjectFilter.php delete mode 100644 vendor/psr/log/.gitignore create mode 100644 vendor/psr/log/Psr/Log/Test/DummyTest.php create mode 100644 vendor/setasign/fpdi/SECURITY.md diff --git a/composer.json b/composer.json index be28534..c7d803b 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "Event Tickets' RSVP, Tribe Commerce PayPal, WooCommerce, and/or Easy Digital Downloads ticket emails will become PDF files saved to your Uploads directory and then get attached to the ticket emails.", "type": "project", "require": { - "mpdf/mpdf": "~8.0.0" + "mpdf/mpdf": "^8.0.4" }, "license": "GPL-2.0-only", "authors": [ diff --git a/composer.lock b/composer.lock index 096d5d6..e4b4255 100644 --- a/composer.lock +++ b/composer.lock @@ -1,23 +1,23 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9a8a3efb28df3020a85b9a9e4e5a7fd8", + "content-hash": "2cbea618c7341e33820e34775d1a0d98", "packages": [ { "name": "mpdf/mpdf", - "version": "v8.0.0", + "version": "v8.0.6", "source": { "type": "git", "url": "https://github.com/mpdf/mpdf.git", - "reference": "c13ebc0fd5cc0613dfb1fd37d55a67859b92cf0c" + "reference": "d27aa93513b915896fa7cb53901d3122e286f811" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mpdf/mpdf/zipball/c13ebc0fd5cc0613dfb1fd37d55a67859b92cf0c", - "reference": "c13ebc0fd5cc0613dfb1fd37d55a67859b92cf0c", + "url": "https://api.github.com/repos/mpdf/mpdf/zipball/d27aa93513b915896fa7cb53901d3122e286f811", + "reference": "d27aa93513b915896fa7cb53901d3122e286f811", "shasum": "" }, "require": { @@ -25,7 +25,7 @@ "ext-mbstring": "*", "myclabs/deep-copy": "^1.7", "paragonie/random_compat": "^1.4|^2.0|9.99.99", - "php": "^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0", + "php": "^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0", "psr/log": "^1.0", "setasign/fpdi": "^2.1" }, @@ -33,7 +33,7 @@ "mockery/mockery": "^0.9.5", "mpdf/qrcode": "^1.0.0", "phpunit/phpunit": "^5.0", - "squizlabs/php_codesniffer": "^2.7.0", + "squizlabs/php_codesniffer": "^3.5.0", "tracy/tracy": "^2.4" }, "suggest": { @@ -73,20 +73,26 @@ "php", "utf-8" ], - "time": "2019-03-15T22:03:58+00:00" + "funding": [ + { + "url": "https://www.paypal.me/mpdf", + "type": "custom" + } + ], + "time": "2020-05-25T09:08:39+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.8.1", + "version": "1.9.5", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", - "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef", + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef", "shasum": "" }, "require": { @@ -121,7 +127,7 @@ "object", "object graph" ], - "time": "2018-06-11T23:09:50+00:00" + "time": "2020-01-17T21:11:47+00:00" }, { "name": "paragonie/random_compat", @@ -170,16 +176,16 @@ }, { "name": "psr/log", - "version": "1.1.0", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", "shasum": "" }, "require": { @@ -188,7 +194,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { @@ -213,37 +219,37 @@ "psr", "psr-3" ], - "time": "2018-11-20T15:27:04+00:00" + "time": "2020-03-23T09:12:05+00:00" }, { "name": "setasign/fpdi", - "version": "v2.2.0", + "version": "v2.3.3", "source": { "type": "git", "url": "https://github.com/Setasign/FPDI.git", - "reference": "3c266002f8044f61b17329f7cd702d44d73f0f7f" + "reference": "50c388860a73191e010810ed57dbed795578e867" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Setasign/FPDI/zipball/3c266002f8044f61b17329f7cd702d44d73f0f7f", - "reference": "3c266002f8044f61b17329f7cd702d44d73f0f7f", + "url": "https://api.github.com/repos/Setasign/FPDI/zipball/50c388860a73191e010810ed57dbed795578e867", + "reference": "50c388860a73191e010810ed57dbed795578e867", "shasum": "" }, "require": { "ext-zlib": "*", "php": "^5.6 || ^7.0" }, + "conflict": { + "setasign/tfpdf": "<1.31" + }, "require-dev": { "phpunit/phpunit": "~5.7", "setasign/fpdf": "~1.8", - "setasign/tfpdf": "1.25", + "setasign/tfpdf": "1.31", "tecnickcom/tcpdf": "~6.2" }, "suggest": { - "setasign/fpdf": "FPDI will extend this class but as it is also possible to use TCPDF or tFPDF as an alternative. There's no fixed dependency configured.", - "setasign/fpdi-fpdf": "Use this package to automatically evaluate dependencies to FPDF.", - "setasign/fpdi-tcpdf": "Use this package to automatically evaluate dependencies to TCPDF.", - "setasign/fpdi-tfpdf": "Use this package to automatically evaluate dependencies to tFPDF." + "setasign/fpdf": "FPDI will extend this class but as it is also possible to use TCPDF or tFPDF as an alternative. There's no fixed dependency configured." }, "type": "library", "autoload": { @@ -274,7 +280,13 @@ "fpdi", "pdf" ], - "time": "2019-01-30T14:11:19+00:00" + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/setasign/fpdi", + "type": "tidelift" + } + ], + "time": "2020-04-28T12:40:35+00:00" } ], "packages-dev": [], @@ -284,5 +296,6 @@ "prefer-stable": false, "prefer-lowest": false, "platform": [], - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "1.1.0" } diff --git a/vendor/autoload.php b/vendor/autoload.php index f7da6ed..2cadd52 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInitd3d2973c0b8caee096c5a70eea3d2207::getLoader(); +return ComposerAutoloaderInitfd9cbdfd695458526decd277b993e840::getLoader(); diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index 2c72175..fce8549 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -279,7 +279,7 @@ public function isClassMapAuthoritative() */ public function setApcuPrefix($apcuPrefix) { - $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null; + $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; } /** @@ -377,11 +377,11 @@ private function findFileWithExtension($class, $ext) $subPath = $class; while (false !== $lastPos = strrpos($subPath, '\\')) { $subPath = substr($subPath, 0, $lastPos); - $search = $subPath.'\\'; + $search = $subPath . '\\'; if (isset($this->prefixDirsPsr4[$search])) { + $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); foreach ($this->prefixDirsPsr4[$search] as $dir) { - $length = $this->prefixLengthsPsr4[$first][$search]; - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { + if (file_exists($file = $dir . $pathEnd)) { return $file; } } diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index dd9ed6e..7a689a7 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -25,6 +25,7 @@ 'DeepCopy\\TypeFilter\\Date\\DateIntervalFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DateIntervalFilter.php', 'DeepCopy\\TypeFilter\\ReplaceFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/ReplaceFilter.php', 'DeepCopy\\TypeFilter\\ShallowCopyFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/ShallowCopyFilter.php', + 'DeepCopy\\TypeFilter\\Spl\\ArrayObjectFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/ArrayObjectFilter.php', 'DeepCopy\\TypeFilter\\Spl\\SplDoublyLinkedList' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedList.php', 'DeepCopy\\TypeFilter\\Spl\\SplDoublyLinkedListFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedListFilter.php', 'DeepCopy\\TypeFilter\\TypeFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/TypeFilter.php', @@ -63,7 +64,9 @@ 'Mpdf\\Css\\DefaultCss' => $vendorDir . '/mpdf/mpdf/src/Css/DefaultCss.php', 'Mpdf\\Css\\TextVars' => $vendorDir . '/mpdf/mpdf/src/Css/TextVars.php', 'Mpdf\\DirectWrite' => $vendorDir . '/mpdf/mpdf/src/DirectWrite.php', + 'Mpdf\\Exception\\FontException' => $vendorDir . '/mpdf/mpdf/src/Exception/FontException.php', 'Mpdf\\Exception\\InvalidArgumentException' => $vendorDir . '/mpdf/mpdf/src/Exception/InvalidArgumentException.php', + 'Mpdf\\File\\StreamWrapperChecker' => $vendorDir . '/mpdf/mpdf/src/File/StreamWrapperChecker.php', 'Mpdf\\Fonts\\FontCache' => $vendorDir . '/mpdf/mpdf/src/Fonts/FontCache.php', 'Mpdf\\Fonts\\FontFileFinder' => $vendorDir . '/mpdf/mpdf/src/Fonts/FontFileFinder.php', 'Mpdf\\Fonts\\GlyphOperator' => $vendorDir . '/mpdf/mpdf/src/Fonts/GlyphOperator.php', @@ -244,7 +247,7 @@ 'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php', 'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php', 'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php', - 'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', + 'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/DummyTest.php', 'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', 'Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php', 'setasign\\Fpdi\\FpdfTpl' => $vendorDir . '/setasign/fpdi/src/FpdfTpl.php', diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index c3fafd8..b9ba9c1 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitd3d2973c0b8caee096c5a70eea3d2207 +class ComposerAutoloaderInitfd9cbdfd695458526decd277b993e840 { private static $loader; @@ -13,21 +13,24 @@ public static function loadClassLoader($class) } } + /** + * @return \Composer\Autoload\ClassLoader + */ public static function getLoader() { if (null !== self::$loader) { return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInitd3d2973c0b8caee096c5a70eea3d2207', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInitfd9cbdfd695458526decd277b993e840', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInitd3d2973c0b8caee096c5a70eea3d2207', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInitfd9cbdfd695458526decd277b993e840', 'loadClassLoader')); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); if ($useStaticLoader) { require_once __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInitd3d2973c0b8caee096c5a70eea3d2207::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInitfd9cbdfd695458526decd277b993e840::getInitializer($loader)); } else { $map = require __DIR__ . '/autoload_namespaces.php'; foreach ($map as $namespace => $path) { @@ -48,19 +51,19 @@ public static function getLoader() $loader->register(true); if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInitd3d2973c0b8caee096c5a70eea3d2207::$files; + $includeFiles = Composer\Autoload\ComposerStaticInitfd9cbdfd695458526decd277b993e840::$files; } else { $includeFiles = require __DIR__ . '/autoload_files.php'; } foreach ($includeFiles as $fileIdentifier => $file) { - composerRequired3d2973c0b8caee096c5a70eea3d2207($fileIdentifier, $file); + composerRequirefd9cbdfd695458526decd277b993e840($fileIdentifier, $file); } return $loader; } } -function composerRequired3d2973c0b8caee096c5a70eea3d2207($fileIdentifier, $file) +function composerRequirefd9cbdfd695458526decd277b993e840($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { require $file; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 53576a6..243bed1 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInitd3d2973c0b8caee096c5a70eea3d2207 +class ComposerStaticInitfd9cbdfd695458526decd277b993e840 { public static $files = array ( '6124b4c8570aa390c21fafd04a26c69f' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', @@ -68,6 +68,7 @@ class ComposerStaticInitd3d2973c0b8caee096c5a70eea3d2207 'DeepCopy\\TypeFilter\\Date\\DateIntervalFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DateIntervalFilter.php', 'DeepCopy\\TypeFilter\\ReplaceFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/ReplaceFilter.php', 'DeepCopy\\TypeFilter\\ShallowCopyFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/ShallowCopyFilter.php', + 'DeepCopy\\TypeFilter\\Spl\\ArrayObjectFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/ArrayObjectFilter.php', 'DeepCopy\\TypeFilter\\Spl\\SplDoublyLinkedList' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedList.php', 'DeepCopy\\TypeFilter\\Spl\\SplDoublyLinkedListFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedListFilter.php', 'DeepCopy\\TypeFilter\\TypeFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/TypeFilter.php', @@ -106,7 +107,9 @@ class ComposerStaticInitd3d2973c0b8caee096c5a70eea3d2207 'Mpdf\\Css\\DefaultCss' => __DIR__ . '/..' . '/mpdf/mpdf/src/Css/DefaultCss.php', 'Mpdf\\Css\\TextVars' => __DIR__ . '/..' . '/mpdf/mpdf/src/Css/TextVars.php', 'Mpdf\\DirectWrite' => __DIR__ . '/..' . '/mpdf/mpdf/src/DirectWrite.php', + 'Mpdf\\Exception\\FontException' => __DIR__ . '/..' . '/mpdf/mpdf/src/Exception/FontException.php', 'Mpdf\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/mpdf/mpdf/src/Exception/InvalidArgumentException.php', + 'Mpdf\\File\\StreamWrapperChecker' => __DIR__ . '/..' . '/mpdf/mpdf/src/File/StreamWrapperChecker.php', 'Mpdf\\Fonts\\FontCache' => __DIR__ . '/..' . '/mpdf/mpdf/src/Fonts/FontCache.php', 'Mpdf\\Fonts\\FontFileFinder' => __DIR__ . '/..' . '/mpdf/mpdf/src/Fonts/FontFileFinder.php', 'Mpdf\\Fonts\\GlyphOperator' => __DIR__ . '/..' . '/mpdf/mpdf/src/Fonts/GlyphOperator.php', @@ -287,7 +290,7 @@ class ComposerStaticInitd3d2973c0b8caee096c5a70eea3d2207 'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php', 'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.php', 'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php', - 'Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', + 'Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/DummyTest.php', 'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', 'Psr\\Log\\Test\\TestLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/TestLogger.php', 'setasign\\Fpdi\\FpdfTpl' => __DIR__ . '/..' . '/setasign/fpdi/src/FpdfTpl.php', @@ -342,9 +345,9 @@ class ComposerStaticInitd3d2973c0b8caee096c5a70eea3d2207 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitd3d2973c0b8caee096c5a70eea3d2207::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitd3d2973c0b8caee096c5a70eea3d2207::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitd3d2973c0b8caee096c5a70eea3d2207::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInitfd9cbdfd695458526decd277b993e840::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitfd9cbdfd695458526decd277b993e840::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInitfd9cbdfd695458526decd277b993e840::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index f65d4a6..aea0163 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1,17 +1,94 @@ [ + { + "name": "mpdf/mpdf", + "version": "v8.0.6", + "version_normalized": "8.0.6.0", + "source": { + "type": "git", + "url": "https://github.com/mpdf/mpdf.git", + "reference": "d27aa93513b915896fa7cb53901d3122e286f811" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mpdf/mpdf/zipball/d27aa93513b915896fa7cb53901d3122e286f811", + "reference": "d27aa93513b915896fa7cb53901d3122e286f811", + "shasum": "" + }, + "require": { + "ext-gd": "*", + "ext-mbstring": "*", + "myclabs/deep-copy": "^1.7", + "paragonie/random_compat": "^1.4|^2.0|9.99.99", + "php": "^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0", + "psr/log": "^1.0", + "setasign/fpdi": "^2.1" + }, + "require-dev": { + "mockery/mockery": "^0.9.5", + "mpdf/qrcode": "^1.0.0", + "phpunit/phpunit": "^5.0", + "squizlabs/php_codesniffer": "^3.5.0", + "tracy/tracy": "^2.4" + }, + "suggest": { + "ext-bcmath": "Needed for generation of some types of barcodes", + "ext-xml": "Needed mainly for SVG manipulation", + "ext-zlib": "Needed for compression of embedded resources, such as fonts" + }, + "time": "2020-05-25T09:08:39+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-development": "7.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Mpdf\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-only" + ], + "authors": [ + { + "name": "Matěj Humpál", + "role": "Developer, maintainer" + }, + { + "name": "Ian Back", + "role": "Developer (retired)" + } + ], + "description": "PHP library generating PDF files from UTF-8 encoded HTML", + "homepage": "https://mpdf.github.io", + "keywords": [ + "pdf", + "php", + "utf-8" + ], + "funding": [ + { + "url": "https://www.paypal.me/mpdf", + "type": "custom" + } + ] + }, { "name": "myclabs/deep-copy", - "version": "1.8.1", - "version_normalized": "1.8.1.0", + "version": "1.9.5", + "version_normalized": "1.9.5.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", - "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef", + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef", "shasum": "" }, "require": { @@ -25,7 +102,7 @@ "doctrine/common": "^2.6", "phpunit/phpunit": "^7.1" }, - "time": "2018-06-11T23:09:50+00:00", + "time": "2020-01-17T21:11:47+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -96,92 +173,29 @@ "random" ] }, - { - "name": "setasign/fpdi", - "version": "v2.2.0", - "version_normalized": "2.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/Setasign/FPDI.git", - "reference": "3c266002f8044f61b17329f7cd702d44d73f0f7f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Setasign/FPDI/zipball/3c266002f8044f61b17329f7cd702d44d73f0f7f", - "reference": "3c266002f8044f61b17329f7cd702d44d73f0f7f", - "shasum": "" - }, - "require": { - "ext-zlib": "*", - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "~5.7", - "setasign/fpdf": "~1.8", - "setasign/tfpdf": "1.25", - "tecnickcom/tcpdf": "~6.2" - }, - "suggest": { - "setasign/fpdf": "FPDI will extend this class but as it is also possible to use TCPDF or tFPDF as an alternative. There's no fixed dependency configured.", - "setasign/fpdi-fpdf": "Use this package to automatically evaluate dependencies to FPDF.", - "setasign/fpdi-tcpdf": "Use this package to automatically evaluate dependencies to TCPDF.", - "setasign/fpdi-tfpdf": "Use this package to automatically evaluate dependencies to tFPDF." - }, - "time": "2019-01-30T14:11:19+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "setasign\\Fpdi\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jan Slabon", - "email": "jan.slabon@setasign.com", - "homepage": "https://www.setasign.com" - }, - { - "name": "Maximilian Kresse", - "email": "maximilian.kresse@setasign.com", - "homepage": "https://www.setasign.com" - } - ], - "description": "FPDI is a collection of PHP classes facilitating developers to read pages from existing PDF documents and use them as templates in FPDF. Because it is also possible to use FPDI with TCPDF, there are no fixed dependencies defined. Please see suggestions for packages which evaluates the dependencies automatically.", - "homepage": "https://www.setasign.com/fpdi", - "keywords": [ - "fpdf", - "fpdi", - "pdf" - ] - }, { "name": "psr/log", - "version": "1.1.0", - "version_normalized": "1.1.0.0", + "version": "1.1.3", + "version_normalized": "1.1.3.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", "shasum": "" }, "require": { "php": ">=5.3.0" }, - "time": "2018-11-20T15:27:04+00:00", + "time": "2020-03-23T09:12:05+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "installation-source": "dist", @@ -209,74 +223,72 @@ ] }, { - "name": "mpdf/mpdf", - "version": "v8.0.0", - "version_normalized": "8.0.0.0", + "name": "setasign/fpdi", + "version": "v2.3.3", + "version_normalized": "2.3.3.0", "source": { "type": "git", - "url": "https://github.com/mpdf/mpdf.git", - "reference": "c13ebc0fd5cc0613dfb1fd37d55a67859b92cf0c" + "url": "https://github.com/Setasign/FPDI.git", + "reference": "50c388860a73191e010810ed57dbed795578e867" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mpdf/mpdf/zipball/c13ebc0fd5cc0613dfb1fd37d55a67859b92cf0c", - "reference": "c13ebc0fd5cc0613dfb1fd37d55a67859b92cf0c", + "url": "https://api.github.com/repos/Setasign/FPDI/zipball/50c388860a73191e010810ed57dbed795578e867", + "reference": "50c388860a73191e010810ed57dbed795578e867", "shasum": "" }, "require": { - "ext-gd": "*", - "ext-mbstring": "*", - "myclabs/deep-copy": "^1.7", - "paragonie/random_compat": "^1.4|^2.0|9.99.99", - "php": "^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0", - "psr/log": "^1.0", - "setasign/fpdi": "^2.1" + "ext-zlib": "*", + "php": "^5.6 || ^7.0" + }, + "conflict": { + "setasign/tfpdf": "<1.31" }, "require-dev": { - "mockery/mockery": "^0.9.5", - "mpdf/qrcode": "^1.0.0", - "phpunit/phpunit": "^5.0", - "squizlabs/php_codesniffer": "^2.7.0", - "tracy/tracy": "^2.4" + "phpunit/phpunit": "~5.7", + "setasign/fpdf": "~1.8", + "setasign/tfpdf": "1.31", + "tecnickcom/tcpdf": "~6.2" }, "suggest": { - "ext-bcmath": "Needed for generation of some types of barcodes", - "ext-xml": "Needed mainly for SVG manipulation", - "ext-zlib": "Needed for compression of embedded resources, such as fonts" + "setasign/fpdf": "FPDI will extend this class but as it is also possible to use TCPDF or tFPDF as an alternative. There's no fixed dependency configured." }, - "time": "2019-03-15T22:03:58+00:00", + "time": "2020-04-28T12:40:35+00:00", "type": "library", - "extra": { - "branch-alias": { - "dev-development": "7.x-dev" - } - }, "installation-source": "dist", "autoload": { "psr-4": { - "Mpdf\\": "src/" + "setasign\\Fpdi\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-2.0-only" + "MIT" ], "authors": [ { - "name": "Matěj Humpál", - "role": "Developer, maintainer" + "name": "Jan Slabon", + "email": "jan.slabon@setasign.com", + "homepage": "https://www.setasign.com" }, { - "name": "Ian Back", - "role": "Developer (retired)" + "name": "Maximilian Kresse", + "email": "maximilian.kresse@setasign.com", + "homepage": "https://www.setasign.com" } ], - "description": "PHP library generating PDF files from UTF-8 encoded HTML", - "homepage": "https://mpdf.github.io", + "description": "FPDI is a collection of PHP classes facilitating developers to read pages from existing PDF documents and use them as templates in FPDF. Because it is also possible to use FPDI with TCPDF, there are no fixed dependencies defined. Please see suggestions for packages which evaluates the dependencies automatically.", + "homepage": "https://www.setasign.com/fpdi", "keywords": [ - "pdf", - "php", - "utf-8" + "fpdf", + "fpdi", + "pdf" + ], + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/setasign/fpdi", + "type": "tidelift" + } ] } ] diff --git a/vendor/mpdf/mpdf/.github/FUNDING.yml b/vendor/mpdf/mpdf/.github/FUNDING.yml new file mode 100644 index 0000000..4760137 --- /dev/null +++ b/vendor/mpdf/mpdf/.github/FUNDING.yml @@ -0,0 +1 @@ +custom: https://www.paypal.me/mpdf diff --git a/vendor/mpdf/mpdf/.travis.yml b/vendor/mpdf/mpdf/.travis.yml index 239ee7d..270885a 100644 --- a/vendor/mpdf/mpdf/.travis.yml +++ b/vendor/mpdf/mpdf/.travis.yml @@ -5,11 +5,12 @@ dist: xenial group: edge php: - - 5.6 - - 7.0 + - 7.3 - 7.1 + - 5.6 + - 7.4 - 7.2 - - 7.3 + - 7.0 - nightly matrix: @@ -37,11 +38,11 @@ install: script: - | if [[ "$LINT" == "1" ]]; then - ./vendor/bin/phpcs -v --report-width=160 --standard=ruleset.xml --severity=1 --warning-severity=0 --extensions=php src utils tests + composer cs elif [[ "$COVERAGE" == "1" ]]; then - vendor/bin/phpunit --coverage-text + composer coverage else - vendor/bin/phpunit + composer test fi notifications: diff --git a/vendor/mpdf/mpdf/CHANGELOG.md b/vendor/mpdf/mpdf/CHANGELOG.md index f8fb5f6..6c493ef 100644 --- a/vendor/mpdf/mpdf/CHANGELOG.md +++ b/vendor/mpdf/mpdf/CHANGELOG.md @@ -1,3 +1,29 @@ +mPDF 8.1.x +=========================== + +* Add Page Number Myanmar Language Support +* new `Mpdf\Exception\FontException` extending base `MpdfException` was introduced and is thrown on Font manipulation +* A bit cleaner exception messages for font-related errors +* Use atomicity cache writing. Create a temp file, write the content and finally rename the file to the destination. + +mPDF 8.0.x +=========================== + +* Add C128RAW barcode type to create any barcode (ex: subtype change in middle of barcode) (#1124) +* Add proxy support to curl +* Fixed date and time format in the informations dictionary (#1083, @peterdevpl) +* Checking allowed stream wrappers in CssManager +* PHP 7.4 support (until final 7.4 release with composer --ignore-platform-reqs) +* Improve debugging of remote content issues (@ribeirobreno) +* Added `exposeVersion` configuration variable allowing to hide mPDF version from Producer tag and HTTP headers +* Added the check for JPEG SOF header 0xFF 0xC1 (extended) (@jamiejones85) +* Allows setting `none` as zoom mode in `SetDisplayMode` method, so that OpenAction is not written (#602) +* Allowed image stream whitelist to be customised (#1005, thanks @jakejackson) +* Fixed parsing of top-left-bottom-right CSS rules with !important (#1009) +* Fixed skipping ordered list numbering with page-break-inside: avoid (#339) +* Compound classes selector support, like `.one.two` or `div.message.special` (#538, @peterdevpl) +* Fixed CMYK colors in text-shadow (#1115, @lexilya) + mPDF 8.0.0 =========================== @@ -6,7 +32,9 @@ mPDF 8.0.0 * Updated FPDI dependency to version 2 (thanks a lot, @JanSlabon) - removed `SetImportUse` method - case of `ImportPage` method changed to `importPage` + - similarly, case of `setSourceFile` and `useTemplate` was changed to a lowercase first letter. - signature of `importPage` changed + - returned value of `useTemplate` changed * Moved QRCode generating code portions to external package _mpdf/qrcode_ - This reduced package size considerably (ca 6MB) * Fraction sizes without leading zeros allowed for font sizes (#973, thanks @peterdevpl) diff --git a/vendor/mpdf/mpdf/README.md b/vendor/mpdf/mpdf/README.md index 5f9e849..b0709ee 100644 --- a/vendor/mpdf/mpdf/README.md +++ b/vendor/mpdf/mpdf/README.md @@ -4,20 +4,35 @@ It is based on [FPDF](http://www.fpdf.org/) and [HTML2FPDF](http://html2fpdf.sou (see [CREDITS](CREDITS.txt)), with a number of enhancements. mPDF was written by Ian Back and is released under the [GNU GPL v2 licence](LICENSE.txt). +[![Latest Stable Version](https://poser.pugx.org/mpdf/mpdf/v/stable)](https://packagist.org/packages/mpdf/mpdf) [![Build Status](https://travis-ci.org/mpdf/mpdf.svg?branch=development)](https://travis-ci.org/mpdf/mpdf) +[![Total Downloads](https://poser.pugx.org/mpdf/mpdf/downloads)](https://packagist.org/packages/mpdf/mpdf) +[![License](https://poser.pugx.org/mpdf/mpdf/license)](https://packagist.org/packages/mpdf/mpdf) -> Note: If you are viewing this file on mPDF Github repository homepage or on Packagist, please note that + +> Note: If you are viewing this file on mPDF GitHub repository homepage or on Packagist, please note that > the default repository branch is `development` which can differ from the last stable release. Requirements ============ -**mPDF 7+** requires PHP `^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0`. PHP `mbstring` and `gd` extensions have to be loaded. +PHP versions and extensions +--------------------------- + +- `mPDF >=7.0` is supported on PHP `^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0` +- `PHP 7.3` is supported since `mPDF v7.1.7` +- `PHP 7.4` is supported since `mPDF v8.0.4` + + +PHP `mbstring` and `gd` extensions have to be loaded. Additional extensions may be required for some advanced features such as `zlib` for compression of output and embedded resources such as fonts, `bcmath` for generating barcodes or `xml` for character set conversion and SVG handling. +Known server caveats +-------------------- + mPDF has some problems with fetching external HTTP resources with single threaded servers such as `php -S`. A proper server such as nginx (php-fpm) or Apache is recommended. diff --git a/vendor/mpdf/mpdf/composer.json b/vendor/mpdf/mpdf/composer.json index 99659fa..425d955 100644 --- a/vendor/mpdf/mpdf/composer.json +++ b/vendor/mpdf/mpdf/composer.json @@ -31,7 +31,7 @@ "require": { - "php": "^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0", + "php": "^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0", "ext-gd": "*", "ext-mbstring": "*", @@ -47,7 +47,7 @@ "phpunit/phpunit": "^5.0", "mockery/mockery": "^0.9.5", - "squizlabs/php_codesniffer": "^2.7.0", + "squizlabs/php_codesniffer": "^3.5.0", "tracy/tracy": "^2.4", "mpdf/qrcode": "^1.0.0" @@ -84,7 +84,10 @@ "scripts": { "post-install-cmd": [ "php -r \"chmod('./tmp', 0777);\"" - ] + ], + "cs": "@php vendor/bin/phpcs -v --report-width=160 --standard=ruleset.xml --severity=1 --warning-severity=0 --extensions=php src utils tests", + "test": "@php vendor/bin/phpunit", + "coverage": "@php vendor/bin/phpunit --coverage-text" }, "extra": { diff --git a/vendor/mpdf/mpdf/ruleset.xml b/vendor/mpdf/mpdf/ruleset.xml index 4912971..e70f872 100644 --- a/vendor/mpdf/mpdf/ruleset.xml +++ b/vendor/mpdf/mpdf/ruleset.xml @@ -1,37 +1,43 @@ PSR2 with tabs instead of spaces. - + - - - - + + + + + - + + - + + + + + + - - + + + + - - - - - - + + - - + - + + + - - + + diff --git a/vendor/mpdf/mpdf/src/Barcode.php b/vendor/mpdf/mpdf/src/Barcode.php index 924e160..97054b4 100644 --- a/vendor/mpdf/mpdf/src/Barcode.php +++ b/vendor/mpdf/mpdf/src/Barcode.php @@ -96,6 +96,9 @@ public function getBarcode($code, $type, $pr = 0.0) case 'C128C': // CODE 128 C return new Barcode\Code128($code, 'C'); + case 'C128RAW': // CODE 128 RAW -- code is a space separated list of codes with startcode but without checkdigit,stop,end ex: "105 12 34" + return new Barcode\Code128($code, 'RAW'); + case 'EAN128A': // EAN 128 A return new Barcode\Code128($code, 'A', true); diff --git a/vendor/mpdf/mpdf/src/Barcode/Code128.php b/vendor/mpdf/mpdf/src/Barcode/Code128.php index 4e1e212..e12f4d8 100644 --- a/vendor/mpdf/mpdf/src/Barcode/Code128.php +++ b/vendor/mpdf/mpdf/src/Barcode/Code128.php @@ -148,6 +148,36 @@ protected function init($code, $type, $ean) ]; switch (strtoupper($type)) { + case 'RAW': + $newCode=''; + $startid = false; + foreach (explode(" ", $code) as $v) { + if (is_numeric($v) && round($v, 0) == $v) { + if ($v>=0 && $v<=105) { + if ($startid===false) { + $startid=$v; + } else { + $newCode.=chr($v); + } + } else { + throw new \Mpdf\Barcode\BarcodeException('Invalid CODE128RAW barcode value. 0-105 needed'); + } + } else { + //double spaces generates empty $v any other is not allowed + if ($v!='') { + throw new \Mpdf\Barcode\BarcodeException('Invalid CODE128RAW barcode value. 0-105 needed'); + } + } + } + if ($startid<103 || $startid>105) { + throw new \Mpdf\Barcode\BarcodeException('Invalid CODE128RAW startid value. Must 103,104 or 105 (for A,B or C)'); + } + $keys=''; + for ($i = 0; $i <= 105; ++$i) { + $keys .= chr($i); + } + $code=$newCode; + break; case 'A': $startid = 103; $keys = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_'; @@ -172,7 +202,10 @@ protected function init($code, $type, $ean) $newCode = ''; $hclen = (strlen($code) / 2); for ($i = 0; $i < $hclen; ++$i) { - $newCode .= chr((int) ($code{(2 * $i)} . $code{(2 * $i + 1)})); + if ($code[2 * $i]<"0" || $code[2 * $i]>"9" || $code[2 * $i + 1]<"0" || $code[2 * $i + 1]>"9") { + throw new \Mpdf\Barcode\BarcodeException(sprintf('Invalid character "%s" in CODE128C barcode value', $code[$i])); + } + $newCode .= chr((int) ($code[2 * $i] . $code[2 * $i + 1])); } $code = $newCode; break; @@ -192,6 +225,9 @@ protected function init($code, $type, $ean) if ($ean && $i == 0) { $sum += 102; } else { + if (strpos($keys, $code[$i]) === false) { + throw new \Mpdf\Barcode\BarcodeException(sprintf('Invalid character "%s" in CODE128'.$type.' barcode value', $code[$i])); + } $sum += (strpos($keys, $code[$i]) * ($i + 1)); } } diff --git a/vendor/mpdf/mpdf/src/Barcode/Code93.php b/vendor/mpdf/mpdf/src/Barcode/Code93.php index 4be240f..a3f7b25 100644 --- a/vendor/mpdf/mpdf/src/Barcode/Code93.php +++ b/vendor/mpdf/mpdf/src/Barcode/Code93.php @@ -119,10 +119,10 @@ private function init($code) $clen = strlen($code); for ($i = 0; $i < $clen; ++$i) { - if (ord($code{$i}) > 127) { - throw new \Mpdf\Barcode\BarcodeException(sprintf('Invalid character "%s" in Code93 barcode value', $code{$i})); + if (ord($code[$i]) > 127) { + throw new \Mpdf\Barcode\BarcodeException(sprintf('Invalid character "%s" in Code93 barcode value', $code[$i])); } - $code_ext .= $encode[$code{$i}]; + $code_ext .= $encode[$code[$i]]; } // checksum @@ -135,7 +135,7 @@ private function init($code) $clen = strlen($code); for ($i = 0; $i < $clen; ++$i) { - $char = ord($code{$i}); + $char = ord($code[$i]); if (!isset($chr[$char])) { // invalid character throw new \Mpdf\Barcode\BarcodeException('Invalid CODE93 barcode value'); @@ -146,7 +146,7 @@ private function init($code) } else { $t = false; // space } - $w = $chr[$char]{$j}; + $w = $chr[$char][$j]; $bararray['bcode'][$k] = ['t' => $t, 'w' => $w, 'h' => 1, 'p' => 0]; $bararray['maxw'] += $w; ++$k; @@ -183,7 +183,7 @@ protected function checksum($code) $p = 1; $check = 0; for ($i = ($len - 1); $i >= 0; --$i) { - $k = array_keys($chars, $code{$i}); + $k = array_keys($chars, $code[$i]); $check += ($k[0] * $p); ++$p; if ($p > 20) { @@ -198,7 +198,7 @@ protected function checksum($code) $p = 1; $check = 0; for ($i = $len; $i >= 0; --$i) { - $k = array_keys($chars, $code{$i}); + $k = array_keys($chars, $code[$i]); $check += ($k[0] * $p); ++$p; if ($p > 15) { diff --git a/vendor/mpdf/mpdf/src/Barcode/EanExt.php b/vendor/mpdf/mpdf/src/Barcode/EanExt.php index 65afb71..21044a7 100644 --- a/vendor/mpdf/mpdf/src/Barcode/EanExt.php +++ b/vendor/mpdf/mpdf/src/Barcode/EanExt.php @@ -43,7 +43,7 @@ private function init($code, $length = 5) if ($length == 2) { $r = $code % 4; } elseif ($length == 5) { - $r = (3 * ($code{0} + $code{2} + $code{4})) + (9 * ($code{1} + $code{3})); + $r = (3 * ($code[0] + $code[2] + $code[4])) + (9 * ($code[1] + $code[3])); $r %= 10; } else { throw new \Mpdf\Barcode\BarcodeException('Invalid EAN barcode value'); @@ -95,7 +95,7 @@ private function init($code, $length = 5) ]; $p = $parities[$length][$r]; $seq = '1011'; // left guard bar - $seq .= $codes[$p[0]][$code{0}]; + $seq .= $codes[$p[0]][$code[0]]; for ($i = 1; $i < $length; ++$i) { $seq .= '01'; // separator $seq .= $codes[$p[$i]][$code[$i]]; diff --git a/vendor/mpdf/mpdf/src/Barcode/EanUpc.php b/vendor/mpdf/mpdf/src/Barcode/EanUpc.php index aabf8e9..d4eab70 100644 --- a/vendor/mpdf/mpdf/src/Barcode/EanUpc.php +++ b/vendor/mpdf/mpdf/src/Barcode/EanUpc.php @@ -35,6 +35,10 @@ public function __construct($code, $length, $leftMargin, $rightMargin, $xDim, $b */ private function init($code, $length) { + if (preg_match('/[\D]+/', $code)) { + throw new \Mpdf\Barcode\BarcodeException('Invalid EAN UPC barcode value'); + } + $upce = false; $checkdigit = false; @@ -209,7 +213,7 @@ private function init($code, $length) if ($upce && isset($upceCode)) { $bararray = ['code' => $upceCode, 'maxw' => 0, 'maxh' => 1, 'bcode' => []]; - $p = $upceParities[$code{1}][$r]; + $p = $upceParities[$code[1]][$r]; for ($i = 0; $i < 6; ++$i) { $seq .= $codes[$p[$i]][$upceCode[$i]]; } @@ -222,7 +226,7 @@ private function init($code, $length) $seq .= $codes['A'][$code[$i]]; } } else { - $p = $parities[$code{0}]; + $p = $parities[$code[0]]; for ($i = 1; $i < $halfLen; ++$i) { $seq .= $codes[$p[$i - 1]][$code[$i]]; } diff --git a/vendor/mpdf/mpdf/src/Barcode/Imb.php b/vendor/mpdf/mpdf/src/Barcode/Imb.php index 71756bf..0743595 100644 --- a/vendor/mpdf/mpdf/src/Barcode/Imb.php +++ b/vendor/mpdf/mpdf/src/Barcode/Imb.php @@ -112,9 +112,9 @@ private function init($code, $gapWidth, $daft) } $binaryCode = bcmul($binaryCode, 10); - $binaryCode = bcadd($binaryCode, $trackingNumber{0}); + $binaryCode = bcadd($binaryCode, $trackingNumber[0]); $binaryCode = bcmul($binaryCode, 5); - $binaryCode = bcadd($binaryCode, $trackingNumber{1}); + $binaryCode = bcadd($binaryCode, $trackingNumber[1]); $binaryCode .= substr($trackingNumber, 2, 18); diff --git a/vendor/mpdf/mpdf/src/Cache.php b/vendor/mpdf/mpdf/src/Cache.php index 7356131..bc6bc91 100644 --- a/vendor/mpdf/mpdf/src/Cache.php +++ b/vendor/mpdf/mpdf/src/Cache.php @@ -70,9 +70,11 @@ public function load($filename) public function write($filename, $data) { - $path = $this->getFilePath($filename); + $tempFile = tempnam($this->basePath, 'cache_tmp_'); + file_put_contents($tempFile, $data); - file_put_contents($path, $data); + $path = $this->getFilePath($filename); + rename($tempFile, $path); return $path; } diff --git a/vendor/mpdf/mpdf/src/Color/ColorConverter.php b/vendor/mpdf/mpdf/src/Color/ColorConverter.php index 3fc0dc8..0eeb2bd 100644 --- a/vendor/mpdf/mpdf/src/Color/ColorConverter.php +++ b/vendor/mpdf/mpdf/src/Color/ColorConverter.php @@ -66,15 +66,15 @@ public function lighten($c) { $this->ensureBinaryColorFormat($c); - if ($c{0} == static::MODE_RGB || $c{0} == static::MODE_RGBA) { - list($h, $s, $l) = $this->colorModeConverter->rgb2hsl(ord($c{1}) / 255, ord($c{2}) / 255, ord($c{3}) / 255); + if ($c[0] == static::MODE_RGB || $c[0] == static::MODE_RGBA) { + list($h, $s, $l) = $this->colorModeConverter->rgb2hsl(ord($c[1]) / 255, ord($c[2]) / 255, ord($c[3]) / 255); $l += ((1 - $l) * 0.8); list($r, $g, $b) = $this->colorModeConverter->hsl2rgb($h, $s, $l); $ret = [3, $r, $g, $b]; - } elseif ($c{0} == static::MODE_CMYK || $c{0} == static::MODE_CMYKA) { - $ret = [4, max(0, ord($c{1}) - 20), max(0, ord($c{2}) - 20), max(0, ord($c{3}) - 20), max(0, ord($c{4}) - 20)]; - } elseif ($c{0} == static::MODE_GRAYSCALE) { - $ret = [1, min(255, ord($c{1}) + 32)]; + } elseif ($c[0] == static::MODE_CMYK || $c[0] == static::MODE_CMYKA) { + $ret = [4, max(0, ord($c[1]) - 20), max(0, ord($c[2]) - 20), max(0, ord($c[3]) - 20), max(0, ord($c[4]) - 20)]; + } elseif ($c[0] == static::MODE_GRAYSCALE) { + $ret = [1, min(255, ord($c[1]) + 32)]; } $c = array_pad($ret, 6, 0); @@ -87,16 +87,16 @@ public function darken($c) { $this->ensureBinaryColorFormat($c); - if ($c{0} == static::MODE_RGB || $c{0} == static::MODE_RGBA) { - list($h, $s, $l) = $this->colorModeConverter->rgb2hsl(ord($c{1}) / 255, ord($c{2}) / 255, ord($c{3}) / 255); + if ($c[0] == static::MODE_RGB || $c[0] == static::MODE_RGBA) { + list($h, $s, $l) = $this->colorModeConverter->rgb2hsl(ord($c[1]) / 255, ord($c[2]) / 255, ord($c[3]) / 255); $s *= 0.25; $l *= 0.75; list($r, $g, $b) = $this->colorModeConverter->hsl2rgb($h, $s, $l); $ret = [3, $r, $g, $b]; - } elseif ($c{0} == static::MODE_CMYK || $c{0} == static::MODE_CMYKA) { - $ret = [4, min(100, ord($c{1}) + 20), min(100, ord($c{2}) + 20), min(100, ord($c{3}) + 20), min(100, ord($c{4}) + 20)]; - } elseif ($c{0} == static::MODE_GRAYSCALE) { - $ret = [1, max(0, ord($c{1}) - 32)]; + } elseif ($c[0] == static::MODE_CMYK || $c[0] == static::MODE_CMYKA) { + $ret = [4, min(100, ord($c[1]) + 20), min(100, ord($c[2]) + 20), min(100, ord($c[3]) + 20), min(100, ord($c[4]) + 20)]; + } elseif ($c[0] == static::MODE_GRAYSCALE) { + $ret = [1, max(0, ord($c[1]) - 32)]; } $c = array_pad($ret, 6, 0); $cstr = pack('a1ccccc', $c[0], $c[1] & 0xFF, $c[2] & 0xFF, $c[3] & 0xFF, $c[4] & 0xFF, $c[5] & 0xFF); @@ -112,16 +112,16 @@ public function invert($c) { $this->ensureBinaryColorFormat($c); - if ($c{0} == static::MODE_RGB || $c{0} == static::MODE_RGBA) { - return [3, 255 - ord($c{1}), 255 - ord($c{2}), 255 - ord($c{3})]; + if ($c[0] == static::MODE_RGB || $c[0] == static::MODE_RGBA) { + return [3, 255 - ord($c[1]), 255 - ord($c[2]), 255 - ord($c[3])]; } - if ($c{0} == static::MODE_CMYK || $c{0} == static::MODE_CMYKA) { - return [4, 100 - ord($c{1}), 100 - ord($c{2}), 100 - ord($c{3}), 100 - ord($c{4})]; + if ($c[0] == static::MODE_CMYK || $c[0] == static::MODE_CMYKA) { + return [4, 100 - ord($c[1]), 100 - ord($c[2]), 100 - ord($c[3]), 100 - ord($c[4])]; } - if ($c{0} == static::MODE_GRAYSCALE) { - return [1, 255 - ord($c{1})]; + if ($c[0] == static::MODE_GRAYSCALE) { + return [1, 255 - ord($c[1])]; } // Cannot cope with non-RGB colors at present @@ -135,28 +135,28 @@ public function invert($c) */ public function colAtoString($c) { - if ($c{0} == static::MODE_GRAYSCALE) { - return 'rgb(' . ord($c{1}) . ', ' . ord($c{1}) . ', ' . ord($c{1}) . ')'; + if ($c[0] == static::MODE_GRAYSCALE) { + return 'rgb(' . ord($c[1]) . ', ' . ord($c[1]) . ', ' . ord($c[1]) . ')'; } - if ($c{0} == static::MODE_SPOT) { - return 'spot(' . ord($c{1}) . ', ' . ord($c{2}) . ')'; + if ($c[0] == static::MODE_SPOT) { + return 'spot(' . ord($c[1]) . ', ' . ord($c[2]) . ')'; } - if ($c{0} == static::MODE_RGB) { - return 'rgb(' . ord($c{1}) . ', ' . ord($c{2}) . ', ' . ord($c{3}) . ')'; + if ($c[0] == static::MODE_RGB) { + return 'rgb(' . ord($c[1]) . ', ' . ord($c[2]) . ', ' . ord($c[3]) . ')'; } - if ($c{0} == static::MODE_CMYK) { - return 'cmyk(' . ord($c{1}) . ', ' . ord($c{2}) . ', ' . ord($c{3}) . ', ' . ord($c{4}) . ')'; + if ($c[0] == static::MODE_CMYK) { + return 'cmyk(' . ord($c[1]) . ', ' . ord($c[2]) . ', ' . ord($c[3]) . ', ' . ord($c[4]) . ')'; } - if ($c{0} == static::MODE_RGBA) { - return 'rgba(' . ord($c{1}) . ', ' . ord($c{2}) . ', ' . ord($c{3}) . ', ' . sprintf('%0.2F', ord($c{4}) / 100) . ')'; + if ($c[0] == static::MODE_RGBA) { + return 'rgba(' . ord($c[1]) . ', ' . ord($c[2]) . ', ' . ord($c[3]) . ', ' . sprintf('%0.2F', ord($c[4]) / 100) . ')'; } - if ($c{0} == static::MODE_CMYKA) { - return 'cmyka(' . ord($c{1}) . ', ' . ord($c{2}) . ', ' . ord($c{3}) . ', ' . ord($c{4}) . ', ' . sprintf('%0.2F', ord($c{5}) / 100) . ')'; + if ($c[0] == static::MODE_CMYKA) { + return 'cmyka(' . ord($c[1]) . ', ' . ord($c[2]) . ', ' . ord($c[3]) . ', ' . ord($c[4]) . ', ' . sprintf('%0.2F', ord($c[5]) / 100) . ')'; } return ''; diff --git a/vendor/mpdf/mpdf/src/Color/ColorModeConverter.php b/vendor/mpdf/mpdf/src/Color/ColorModeConverter.php index 4b93009..610cff4 100644 --- a/vendor/mpdf/mpdf/src/Color/ColorModeConverter.php +++ b/vendor/mpdf/mpdf/src/Color/ColorModeConverter.php @@ -52,6 +52,7 @@ public function rgb2cmyk($c) //if ($c[0]==5) { return array (6,0,0,0,100, $c[4]); } //else { return array (4,0,0,0,100); } } + $K = $min; $black = 1 - $K; if ($c[0] == 5) { diff --git a/vendor/mpdf/mpdf/src/Color/ColorSpaceRestrictor.php b/vendor/mpdf/mpdf/src/Color/ColorSpaceRestrictor.php index 4ae52cc..195138f 100644 --- a/vendor/mpdf/mpdf/src/Color/ColorSpaceRestrictor.php +++ b/vendor/mpdf/mpdf/src/Color/ColorSpaceRestrictor.php @@ -50,10 +50,14 @@ public function __construct(Mpdf $mpdf, ColorModeConverter $colorModeConverter, * @param string $color * @param string[] $PDFAXwarnings * - * @return float[] + * @return float[]|mixed */ public function restrictColorSpace($c, $color, &$PDFAXwarnings = []) { + if (!is_array($c)) { + return $c; + } + $mode = (int) $c[0]; switch ($mode) { case 1: diff --git a/vendor/mpdf/mpdf/src/Config/ConfigVariables.php b/vendor/mpdf/mpdf/src/Config/ConfigVariables.php index 254045d..324f421 100644 --- a/vendor/mpdf/mpdf/src/Config/ConfigVariables.php +++ b/vendor/mpdf/mpdf/src/Config/ConfigVariables.php @@ -295,6 +295,10 @@ public function __construct() // Default dpi to output images if size not defined // See also above "dpi" 'img_dpi' => 96, + // Specify whitelisted PHP streams to be used for images + // Useful to add custom streams like `s3` + // Note: for security reasons the `phar` stream cannot be used @see https://github.com/mpdf/mpdf/issues/949 + 'whitelistStreamWrappers' => ['http', 'https', 'file'], // TEXT SPACING & JUSTIFICATION @@ -508,6 +512,10 @@ public function __construct() 'curlAllowUnsafeSslRequests' => false, 'curlCaCertificate' => '', 'curlTimeout' => 5, + 'curlProxy' => null, + 'curlProxyAuth' => null, + + 'exposeVersion' => true, ]; } diff --git a/vendor/mpdf/mpdf/src/Conversion/DecToOther.php b/vendor/mpdf/mpdf/src/Conversion/DecToOther.php index 254c6fa..1eafb2c 100644 --- a/vendor/mpdf/mpdf/src/Conversion/DecToOther.php +++ b/vendor/mpdf/mpdf/src/Conversion/DecToOther.php @@ -60,6 +60,7 @@ public function getCodePage($script) 'khmer' => 0x17E0, 'cambodian' => 0x17E0, 'lao' => 0x0ED0, + 'myanmar' => 0x1040 ]; return isset($codePages[$script]) ? $codePages[$script] : 0; diff --git a/vendor/mpdf/mpdf/src/CssManager.php b/vendor/mpdf/mpdf/src/CssManager.php index 6a314d0..22a34bd 100644 --- a/vendor/mpdf/mpdf/src/CssManager.php +++ b/vendor/mpdf/mpdf/src/CssManager.php @@ -4,7 +4,7 @@ use Mpdf\Color\ColorConverter; use Mpdf\Css\TextVars; - +use Mpdf\File\StreamWrapperChecker; use Mpdf\Utils\Arrays; use Mpdf\Utils\UtfString; @@ -143,12 +143,14 @@ function ReadCSS($html) } while ($match) { + $path = $CSSext[$ind]; $path = htmlspecialchars_decode($path); // mPDF 6 $this->mpdf->GetFullPath($path); - $CSSextblock = $this->_get_file($path); + + $CSSextblock = $this->getFileContents($path); if ($CSSextblock) { // look for embedded @import stylesheets in other stylesheets // and fix url paths (including background-images) relative to stylesheet @@ -357,7 +359,9 @@ function ReadCSS($html) $tag = ''; if (preg_match('/^[.](.*)$/', $t, $m)) { - $tag = 'CLASS>>' . $m[1]; + $classes = explode('.', $m[1]); + sort($classes); + $tag = 'CLASS>>' . join('.', $classes); } elseif (preg_match('/^[#](.*)$/', $t, $m)) { $tag = 'ID>>' . $m[1]; } elseif (preg_match('/^\[LANG=[\'\"]{0,1}([A-Z\-]{2,11})[\'\"]{0,1}\]$/', $t, $m)) { @@ -365,7 +369,9 @@ function ReadCSS($html) } elseif (preg_match('/^:LANG\([\'\"]{0,1}([A-Z\-]{2,11})[\'\"]{0,1}\)$/', $t, $m)) { // mPDF 6 Special case for lang as attribute selector $tag = 'LANG>>' . strtolower($m[1]); } elseif (preg_match('/^(' . $this->mpdf->allowedCSStags . ')[.](.*)$/', $t, $m)) { // mPDF 6 Special case for lang as attribute selector - $tag = $m[1] . '>>CLASS>>' . $m[2]; + $classes = explode('.', $m[2]); + sort($classes); + $tag = $m[1] . '>>CLASS>>' . join('.', $classes); } elseif (preg_match('/^(' . $this->mpdf->allowedCSStags . ')\s*:NTH-CHILD\((.*)\)$/', $t, $m)) { $tag = $m[1] . '>>SELECTORNTHCHILD>>' . $m[2]; } elseif (preg_match('/^(' . $this->mpdf->allowedCSStags . ')[#](.*)$/', $t, $m)) { @@ -402,7 +408,9 @@ function ReadCSS($html) if ($t) { if (preg_match('/^[.](.*)$/', $t, $m)) { - $tag = 'CLASS>>' . $m[1]; + $classes = explode('.', $m[1]); + sort($classes); + $tag = 'CLASS>>' . join('.', $classes); } elseif (preg_match('/^[#](.*)$/', $t, $m)) { $tag = 'ID>>' . $m[1]; } elseif (preg_match('/^\[LANG=[\'\"]{0,1}([A-Z\-]{2,11})[\'\"]{0,1}\]$/', $t, $m)) { @@ -410,7 +418,9 @@ function ReadCSS($html) } elseif (preg_match('/^:LANG\([\'\"]{0,1}([A-Z\-]{2,11})[\'\"]{0,1}\)$/', $t, $m)) { // mPDF 6 Special case for lang as attribute selector $tag = 'LANG>>' . strtolower($m[1]); } elseif (preg_match('/^(' . $this->mpdf->allowedCSStags . ')[.](.*)$/', $t, $m)) { // mPDF 6 Special case for lang as attribute selector - $tag = $m[1] . '>>CLASS>>' . $m[2]; + $classes = explode('.', $m[2]); + sort($classes); + $tag = $m[1] . '>>CLASS>>' . join('.', $classes); } elseif (preg_match('/^(' . $this->mpdf->allowedCSStags . ')\s*:NTH-CHILD\((.*)\)$/', $t, $m)) { $tag = $m[1] . '>>SELECTORNTHCHILD>>' . $m[2]; } elseif (preg_match('/^(' . $this->mpdf->allowedCSStags . ')[#](.*)$/', $t, $m)) { @@ -1107,37 +1117,57 @@ function setCSStextshadow($v) { $sh = []; $c = preg_match_all('/(rgba|rgb|device-cmyka|cmyka|device-cmyk|cmyk|hsla|hsl)\(.*?\)/', $v, $x); // mPDF 5.6.05 + for ($i = 0; $i < $c; $i++) { - $col = preg_replace('/,/', '*', $x[0][$i]); + $col = preg_replace('/,\s/', '*', $x[0][$i]); $v = str_replace($x[0][$i], $col, $v); } + $ss = explode(',', $v); + foreach ($ss as $s) { + $new = ['blur' => 0]; $p = explode(' ', trim($s)); + if (isset($p[0])) { $new['x'] = $this->sizeConverter->convert(trim($p[0]), $this->mpdf->FontSize, $this->mpdf->FontSize, false); } + if (isset($p[1])) { $new['y'] = $this->sizeConverter->convert(trim($p[1]), $this->mpdf->FontSize, $this->mpdf->FontSize, false); } + if (isset($p[2])) { + if (preg_match('/^\s*[\.\-0-9]/', $p[2])) { - $new['blur'] = $this->sizeConverter->convert(trim($p[2]), $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'], $this->mpdf->FontSize, false); + + $new['blur'] = $this->sizeConverter->convert( + trim($p[2]), + isset($this->mpdf->blk[$this->mpdf->blklvl]['inner_width']) ? $this->mpdf->blk[$this->mpdf->blklvl]['inner_width'] : 0, + $this->mpdf->FontSize, + false + ); + } else { $new['col'] = $this->colorConverter->convert(preg_replace('/\*/', ',', $p[2]), $this->mpdf->PDFAXwarnings); } + if (isset($p[3])) { $new['col'] = $this->colorConverter->convert(preg_replace('/\*/', ',', $p[3]), $this->mpdf->PDFAXwarnings); } } + if (!isset($new['col']) || !$new['col']) { $new['col'] = $this->colorConverter->convert('#888888', $this->mpdf->PDFAXwarnings); } + if (isset($new['y'])) { array_unshift($sh, $new); } + } + return $sh; } @@ -1203,9 +1233,11 @@ function expand24($mp) { $prop = preg_split('/\s+/', trim($mp)); $prop_count = count($prop); + if ($prop_count === 1) { return ['T' => $prop[0], 'R' => $prop[0], 'B' => $prop[0], 'L' => $prop[0]]; } + if ($prop_count === 2) { return ['T' => $prop[0], 'R' => $prop[1], 'B' => $prop[0], 'L' => $prop[1]]; } @@ -1213,9 +1245,12 @@ function expand24($mp) if ($prop_count === 3) { return ['T' => $prop[0], 'R' => $prop[1], 'B' => $prop[2], 'L' => $prop[1]]; } - if ($prop_count === 4) { + + // Ignore rule parts after first 4 values (most likely !important) + if ($prop_count >= 4) { return ['T' => $prop[0], 'R' => $prop[1], 'B' => $prop[2], 'L' => $prop[3]]; } + return []; } @@ -1325,7 +1360,7 @@ function array_merge_recursive_unique($array1, $array2) $ret = $arrays[0]; for ($i = 1; $i < $narrays; $i ++) { foreach ($arrays[$i] as $key => $value) { - if (((string) $key) === ((string)((int) $key))) { // integer or string as integer key - append + if (((string) $key) === ((string) ((int) $key))) { // integer or string as integer key - append $ret[] = $value; } else { // string key - merge if (is_array($value) && isset($ret[$key])) { @@ -1479,7 +1514,9 @@ function MergeCSS($inherit, $tag, $attr) $classes = []; if (isset($attr['CLASS'])) { - $classes = preg_split('/\s+/', $attr['CLASS']); + $classes = array_map(function ($combination) { + return join('.', $combination); + }, Arrays::allUniqueSortedCombinations(preg_split('/\s+/', $attr['CLASS']))); } if (!isset($attr['ID'])) { $attr['ID'] = ''; @@ -2095,7 +2132,9 @@ function PreviewBlockCSS($tag, $attr) $oldcascadeCSS = $this->mpdf->blk[$this->mpdf->blklvl]['cascadeCSS']; $classes = []; if (isset($attr['CLASS'])) { - $classes = preg_split('/\s+/', $attr['CLASS']); + $classes = array_map(function ($combination) { + return join('.', $combination); + }, Arrays::allUniqueSortedCombinations(preg_split('/\s+/', $attr['CLASS']))); } //=============================================== // DEFAULT for this TAG set in DefaultCSS @@ -2234,9 +2273,13 @@ function _nthchild($f, $c) return $select; } - private function _get_file($path) + private function getFileContents($path) { // If local file try using local path (? quicker, but also allowed even if allow_url_fopen false) + $wrapperChecker = new StreamWrapperChecker($this->mpdf); + if ($wrapperChecker->hasBlacklistedStreamWrapper($path)) { + throw new \Mpdf\MpdfException('File contains an invalid stream. Only ' . implode(', ', $wrapperChecker->getWhitelistedStreamWrappers()) . ' streams are allowed.'); + } // mPDF 5.7.3 if (strpos($path, '//') === false) { diff --git a/vendor/mpdf/mpdf/src/Exception/FontException.php b/vendor/mpdf/mpdf/src/Exception/FontException.php new file mode 100644 index 0000000..d00d763 --- /dev/null +++ b/vendor/mpdf/mpdf/src/Exception/FontException.php @@ -0,0 +1,8 @@ +mpdf = $mpdf; + } + + /** + * @param string $filename + * @return bool + * @since 7.1.8 + */ + public function hasBlacklistedStreamWrapper($filename) + { + if (strpos($filename, '://') > 0) { + $wrappers = stream_get_wrappers(); + $whitelistStreamWrappers = $this->getWhitelistedStreamWrappers(); + foreach ($wrappers as $wrapper) { + if (in_array($wrapper, $whitelistStreamWrappers)) { + continue; + } + + if (stripos($filename, $wrapper . '://') === 0) { + return true; + } + } + } + + return false; + } + + public function getWhitelistedStreamWrappers() + { + return array_diff($this->mpdf->whitelistStreamWrappers, ['phar']); // remove 'phar' (security issue) + } + +} diff --git a/vendor/mpdf/mpdf/src/Fonts/FontCache.php b/vendor/mpdf/mpdf/src/Fonts/FontCache.php index 8f46935..2dd0887 100644 --- a/vendor/mpdf/mpdf/src/Fonts/FontCache.php +++ b/vendor/mpdf/mpdf/src/Fonts/FontCache.php @@ -53,9 +53,7 @@ public function write($filename, $data) public function binaryWrite($filename, $data) { - $handle = fopen($this->tempFilename($filename), 'wb'); - fwrite($handle, $data); - fclose($handle); + return $this->cache->write($filename, $data); } public function jsonWrite($filename, $data) diff --git a/vendor/mpdf/mpdf/src/Form.php b/vendor/mpdf/mpdf/src/Form.php index 71865b2..0be548f 100644 --- a/vendor/mpdf/mpdf/src/Form.php +++ b/vendor/mpdf/mpdf/src/Form.php @@ -250,7 +250,7 @@ function print_ob_text($objattr, $w, $h, $texto, $rtlalign, $k, $blockdir) if (!empty($objattr['disabled'])) { $this->mpdf->SetFColor($this->colorConverter->convert(225, $this->mpdf->PDFAXwarnings)); $this->mpdf->SetTColor($this->colorConverter->convert(127, $this->mpdf->PDFAXwarnings)); - } else if (!empty($objattr['readonly'])) { + } elseif (!empty($objattr['readonly'])) { $this->mpdf->SetFColor($this->colorConverter->convert(225, $this->mpdf->PDFAXwarnings)); $this->mpdf->SetTColor($this->colorConverter->convert(0, $this->mpdf->PDFAXwarnings)); } else { @@ -322,7 +322,7 @@ function print_ob_textarea($objattr, $w, $h, $texto, $rtlalign, $k, $blockdir) if (!empty($objattr['disabled'])) { $this->mpdf->SetFColor($this->colorConverter->convert(225, $this->mpdf->PDFAXwarnings)); $this->mpdf->SetTColor($this->colorConverter->convert(127, $this->mpdf->PDFAXwarnings)); - } else if (!empty($objattr['readonly'])) { + } elseif (!empty($objattr['readonly'])) { $this->mpdf->SetFColor($this->colorConverter->convert(225, $this->mpdf->PDFAXwarnings)); $this->mpdf->SetTColor($this->colorConverter->convert(0, $this->mpdf->PDFAXwarnings)); } else { @@ -491,13 +491,13 @@ function print_ob_button($objattr, $w, $h, $texto, $rtlalign, $k, $blockdir) if ($objattr['subtype'] === 'RESET') { $this->SetFormButtonText($objattr['value']); $this->SetFormReset($w, $h, $objattr['fieldname'], $objattr['value'], $objattr['title'], $flags, (isset($objattr['background-col']) ? $objattr['background-col'] : false), (isset($objattr['border-col']) ? $objattr['border-col'] : false), (isset($objattr['noprint']) ? $objattr['noprint'] : false)); - } else if ($objattr['subtype'] === 'SUBMIT') { + } elseif ($objattr['subtype'] === 'SUBMIT') { $url = $this->formAction; $type = $this->formExportType; $method = $this->formMethod; $this->SetFormButtonText($objattr['value']); $this->SetFormSubmit($w, $h, $objattr['fieldname'], $objattr['value'], $url, $objattr['title'], $type, $method, $flags, (isset($objattr['background-col']) ? $objattr['background-col'] : false), (isset($objattr['border-col']) ? $objattr['border-col'] : false), (isset($objattr['noprint']) ? $objattr['noprint'] : false)); - } else if ($objattr['subtype'] === 'BUTTON') { + } elseif ($objattr['subtype'] === 'BUTTON') { $this->SetFormButtonText($objattr['value']); if (isset($objattr['onClick']) && $objattr['onClick']) { $js = $objattr['onClick']; @@ -670,7 +670,7 @@ private function getCountItems($form) } if ($form['subtype'] === 'radio') { $total+=2; - } else if ($form['subtype'] === 'checkbox') { + } elseif ($form['subtype'] === 'checkbox') { $total++; if (!$this->formUseZapD) { $total++; @@ -841,7 +841,7 @@ function SetFormText($w, $h, $name, $value = '', $default = '', $title = '', $fl $this->formCount++; if ($align === 'C') { $align = '1'; - } else if ($align === 'R') { + } elseif ($align === 'R') { $align = '2'; } else { $align = '0'; @@ -913,7 +913,7 @@ function SetFormText($w, $h, $name, $value = '', $default = '', $title = '', $fl } // mPDF 5.3.25 if ($this->mpdf->keep_block_together) { $this->mpdf->ktForms[] = $f; - } else if ($this->mpdf->writingHTMLheader || $this->mpdf->writingHTMLfooter) { + } elseif ($this->mpdf->writingHTMLheader || $this->mpdf->writingHTMLfooter) { $this->mpdf->HTMLheaderPageForms[] = $f; } else { if ($this->mpdf->ColActive) { @@ -924,7 +924,7 @@ function SetFormText($w, $h, $name, $value = '', $default = '', $title = '', $fl 'y' => $this->mpdf->y, 'h' => $h ]; - $this->mpdf->columnForms[$this->mpdf->CurrCol][(int)$this->mpdf->x][(int)$this->mpdf->y] = $this->formCount; + $this->mpdf->columnForms[$this->mpdf->CurrCol][(int) $this->mpdf->x][(int) $this->mpdf->y] = $this->formCount; } $this->forms[$this->formCount] = $f; } @@ -993,13 +993,13 @@ function SetFormChoice($w, $h, $name, $flags, $array, $align = 'L', $js = '') } if ($this->mpdf->keep_block_together) { $this->mpdf->ktForms[] = $f; - } else if ($this->mpdf->writingHTMLheader || $this->mpdf->writingHTMLfooter) { + } elseif ($this->mpdf->writingHTMLheader || $this->mpdf->writingHTMLfooter) { $this->mpdf->HTMLheaderPageForms[] = $f; } else { if ($this->mpdf->ColActive) { $this->mpdf->columnbuffer[] = ['s' => 'ACROFORM', 'col' => $this->mpdf->CurrCol, 'x' => $this->mpdf->x, 'y' => $this->mpdf->y, 'h' => $h]; - $this->mpdf->columnForms[$this->mpdf->CurrCol][(int)$this->mpdf->x][(int)$this->mpdf->y] = $this->formCount; + $this->mpdf->columnForms[$this->mpdf->CurrCol][(int) $this->mpdf->x][(int) $this->mpdf->y] = $this->formCount; } $this->forms[$this->formCount] = $f; } @@ -1110,7 +1110,7 @@ function SetFormButton($bb, $hh, $name, $value, $type, $title = '', $flags = [], $title = $this->writer->utf8ToUtf16BigEndian($title); if ($type === 'checkbox') { $uvalue = $this->writer->utf8ToUtf16BigEndian($value); - } else if ($type === 'radio') { + } elseif ($type === 'radio') { $uvalue = $this->writer->utf8ToUtf16BigEndian($value); $value = mb_convert_encoding($value, 'Windows-1252', 'UTF-8'); } else { @@ -1195,13 +1195,13 @@ function SetFormButton($bb, $hh, $name, $value, $type, $title = '', $flags = [], ]; if ($this->mpdf->keep_block_together) { $this->mpdf->ktForms[] = $f; - } else if ($this->mpdf->writingHTMLheader || $this->mpdf->writingHTMLfooter) { + } elseif ($this->mpdf->writingHTMLheader || $this->mpdf->writingHTMLfooter) { $this->mpdf->HTMLheaderPageForms[] = $f; } else { if ($this->mpdf->ColActive) { $this->mpdf->columnbuffer[] = ['s' => 'ACROFORM', 'col' => $this->mpdf->CurrCol, 'x' => $this->mpdf->x, 'y' => $this->mpdf->y, 'h' => $hh]; - $this->mpdf->columnForms[$this->mpdf->CurrCol][(int)$this->mpdf->x][(int)$this->mpdf->y] = $this->formCount; + $this->mpdf->columnForms[$this->mpdf->CurrCol][(int) $this->mpdf->x][(int) $this->mpdf->y] = $this->formCount; } $this->forms[$this->formCount] = $f; } diff --git a/vendor/mpdf/mpdf/src/FpdiTrait.php b/vendor/mpdf/mpdf/src/FpdiTrait.php index 8a61980..7bc1e54 100644 --- a/vendor/mpdf/mpdf/src/FpdiTrait.php +++ b/vendor/mpdf/mpdf/src/FpdiTrait.php @@ -4,6 +4,9 @@ use setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException; use setasign\Fpdi\PdfParser\Filter\AsciiHex; +use setasign\Fpdi\PdfParser\Type\PdfArray; +use setasign\Fpdi\PdfParser\Type\PdfIndirectObjectReference; +use setasign\Fpdi\PdfReader\PageBoundaries; use setasign\Fpdi\PdfParser\Type\PdfHexString; use setasign\Fpdi\PdfParser\Type\PdfIndirectObject; use setasign\Fpdi\PdfParser\Type\PdfNull; @@ -21,6 +24,7 @@ trait FpdiTrait use \setasign\Fpdi\FpdiTrait { writePdfType as fpdiWritePdfType; useImportedPage as fpdiUseImportedPage; + importPage as fpdiImportPage; } protected $k = Mpdf::SCALE; @@ -128,7 +132,152 @@ public function useImportedPage($pageId, $x = 0, $y = 0, $width = null, $height $this->AddPage(); } - return $this->fpdiUseImportedPage($pageId, $x, $y, $width, $height, $adjustPageSize); + /* Extract $x if an array */ + if (is_array($x)) { + unset($x['pageId']); + extract($x, EXTR_IF_EXISTS); + if (is_array($x)) { + $x = 0; + } + } + + $newSize = $this->fpdiUseImportedPage($pageId, $x, $y, $width, $height, $adjustPageSize); + + $this->setImportedPageLinks($pageId, $x, $y, $newSize); + + return $newSize; + } + + /** + * Imports a page. + * + * @param int $pageNumber The page number. + * @param string $box The page boundary to import. Default set to PageBoundaries::CROP_BOX. + * @param bool $groupXObject Define the form XObject as a group XObject to support transparency (if used). + * @return string A unique string identifying the imported page. + * @throws CrossReferenceException + * @throws FilterException + * @throws PdfParserException + * @throws PdfTypeException + * @throws PdfReaderException + * @see PageBoundaries + */ + public function importPage($pageNumber, $box = PageBoundaries::CROP_BOX, $groupXObject = true) + { + $pageId = $this->fpdiImportPage($pageNumber, $box, $groupXObject); + + $this->importedPages[$pageId]['externalLinks'] = $this->getImportedExternalPageLinks($pageNumber); + + return $pageId; + } + + /** + * Imports the external page links + * + * @param int $pageNumber The page number. + * @return array + * @throws CrossReferenceException + * @throws PdfTypeException + * @throws \setasign\Fpdi\PdfParser\PdfParserException + */ + public function getImportedExternalPageLinks($pageNumber) + { + $links = []; + + $reader = $this->getPdfReader($this->currentReaderId); + $parser = $reader->getParser(); + + $page = $reader->getPage($pageNumber); + $page->getPageDictionary(); + + $annotations = $page->getAttribute('Annots'); + if ($annotations instanceof PdfIndirectObjectReference) { + $annotations = PdfType::resolve($parser->getIndirectObject($annotations->value), $parser); + } + + if ($annotations instanceof PdfArray) { + + $getAttribute = function ($array, $key) { + if (isset($array[$key]->value)) { + return $array[$key]->value; + } + + return ''; + }; + + foreach ($annotations->value as $annotation) { + $annotation = PdfType::resolve($annotation, $parser)->value; + + /* Skip over any annotations that aren't links */ + $type = $getAttribute($annotation, 'Type'); + $subtype = $getAttribute($annotation, 'Subtype'); + if ($type !== 'Annot' || $subtype !== 'Link' || !isset($annotation['A'])) { + continue; + } + + /* Calculate the link positioning */ + $position = $getAttribute($annotation, 'Rect'); + + if (count($position) !== 4) { + continue; + } + + $x1 = $getAttribute($position, 0) / Mpdf::SCALE; + $y1 = $getAttribute($position, 1) / Mpdf::SCALE; + $x2 = $getAttribute($position, 2) / Mpdf::SCALE; + $y2 = $getAttribute($position, 3) / Mpdf::SCALE; + $width = $x2 - $x1; + $height = $y2 - $y1; + + $link = $annotation['A'] instanceof PdfIndirectObjectReference ? PdfType::resolve($annotation['A'], $parser)->value : $getAttribute($annotation, 'A'); + + if (isset($link['URI'])) { + $links[] = [ + 'x' => $x1, + 'y' => $y1, + 'width' => $width, + 'height' => $height, + 'url' => $getAttribute($link, 'URI') + ]; + } + } + } + + return $links; + } + + /** + * @param mixed $pageId The page id + * @param int|float $x The abscissa of upper-left corner. + * @param int|float $y The ordinate of upper-right corner. + * @param array $newSize The size. + */ + public function setImportedPageLinks($pageId, $x, $y, $newSize) + { + $originalSize = $this->getTemplateSize($pageId); + $pageHeightDifference = $this->h - $newSize['height']; + + /* Handle different aspect ratio */ + $widthRatio = $newSize['width'] / $originalSize['width']; + $heightRatio = $newSize['height'] / $originalSize['height']; + + foreach ($this->importedPages[$pageId]['externalLinks'] as $item) { + + $item['x'] *= $widthRatio; + $item['width'] *= $widthRatio; + + $item['y'] *= $heightRatio; + $item['height'] *= $heightRatio; + + $this->Link( + $item['x'] + $x, + /* convert Y to be measured from the top of the page */ + $this->h - $item['y'] - $item['height'] - $pageHeightDifference + $y, + $item['width'], + $item['height'], + $item['url'] + ); + } } /** diff --git a/vendor/mpdf/mpdf/src/Gif/ImageHeader.php b/vendor/mpdf/mpdf/src/Gif/ImageHeader.php index 0717a93..0c39f6f 100644 --- a/vendor/mpdf/mpdf/src/Gif/ImageHeader.php +++ b/vendor/mpdf/mpdf/src/Gif/ImageHeader.php @@ -62,7 +62,7 @@ function load($lpData, &$hdrLen) return false; } - $b = ord($lpData{8}); + $b = ord($lpData[8]); $this->m_bLocalClr = ($b & 0x80) ? true : false; $this->m_bInterlace = ($b & 0x40) ? true : false; $this->m_bSorted = ($b & 0x20) ? true : false; diff --git a/vendor/mpdf/mpdf/src/Gradient.php b/vendor/mpdf/mpdf/src/Gradient.php index 1236e4b..8c42f2a 100644 --- a/vendor/mpdf/mpdf/src/Gradient.php +++ b/vendor/mpdf/mpdf/src/Gradient.php @@ -517,11 +517,11 @@ public function Gradient($x, $y, $w, $h, $type, $stops = [], $colorspace = 'RGB' for ($i = 0; $i < count($stops); $i++) { // mPDF 5.3.74 if ($colorspace === 'CMYK') { - $this->mpdf->gradients[$n]['stops'][$i]['col'] = sprintf('%.3F %.3F %.3F %.3F', ord($stops[$i]['col']{1}) / 100, ord($stops[$i]['col']{2}) / 100, ord($stops[$i]['col']{3}) / 100, ord($stops[$i]['col']{4}) / 100); + $this->mpdf->gradients[$n]['stops'][$i]['col'] = sprintf('%.3F %.3F %.3F %.3F', ord($stops[$i]['col'][1]) / 100, ord($stops[$i]['col'][2]) / 100, ord($stops[$i]['col'][3]) / 100, ord($stops[$i]['col'][4]) / 100); } elseif ($colorspace === 'Gray') { - $this->mpdf->gradients[$n]['stops'][$i]['col'] = sprintf('%.3F', ord($stops[$i]['col']{1}) / 255); + $this->mpdf->gradients[$n]['stops'][$i]['col'] = sprintf('%.3F', ord($stops[$i]['col'][1]) / 255); } else { - $this->mpdf->gradients[$n]['stops'][$i]['col'] = sprintf('%.3F %.3F %.3F', ord($stops[$i]['col']{1}) / 255, ord($stops[$i]['col']{2}) / 255, ord($stops[$i]['col']{3}) / 255); + $this->mpdf->gradients[$n]['stops'][$i]['col'] = sprintf('%.3F %.3F %.3F', ord($stops[$i]['col'][1]) / 255, ord($stops[$i]['col'][2]) / 255, ord($stops[$i]['col'][3]) / 255); } if (!isset($stops[$i]['opacity'])) { $stops[$i]['opacity'] = 1; @@ -712,9 +712,9 @@ private function parseMozLinearGradient($m, $repeat) if (!$col) { $col = $this->colorConverter->convert(255, $this->mpdf->PDFAXwarnings); } - if ($col{0} == 1) { + if ($col[0] == 1) { $g['colorspace'] = 'Gray'; - } elseif ($col{0} == 4 || $col{0} == 6) { + } elseif ($col[0] == 4 || $col[0] == 6) { $g['colorspace'] = 'CMYK'; } @@ -856,9 +856,9 @@ private function parseMozRadialGradient($m, $repeat) if (!$col) { $col = $this->colorConverter->convert(255, $this->mpdf->PDFAXwarnings); } - if ($col{0} == 1) { + if ($col[0] == 1) { $g['colorspace'] = 'Gray'; - } elseif ($col{0} == 4 || $col{0} == 6) { + } elseif ($col[0] == 4 || $col[0] == 6) { $g['colorspace'] = 'CMYK'; } $g['stops'][] = $this->getStop($col, $el); @@ -872,15 +872,15 @@ private function getStop($col, $el, $convertOffset = false) 'col' => $col, ]; - if ($col{0} == 5) { + if ($col[0] == 5) { // transparency from rgba() - $stop['opacity'] = ord($col{4}) / 100; - } elseif ($col{0} == 6) { + $stop['opacity'] = ord($col[4]) / 100; + } elseif ($col[0] == 6) { // transparency from cmyka() - $stop['opacity'] = ord($col{5}) / 100; - } elseif ($col{0} == 1 && $col{2} == 1) { + $stop['opacity'] = ord($col[5]) / 100; + } elseif ($col[0] == 1 && $col[2] == 1) { // transparency converted from rgba or cmyka() - $stop['opacity'] = ord($col{3}) / 100; + $stop['opacity'] = ord($col[3]) / 100; } if (isset($el[1])) { @@ -950,9 +950,9 @@ public function parseBackgroundGradient($bg) $g['colorspace'] = 'RGB'; // mPDF 5.3.74 $cor = $this->colorConverter->convert($bgr[1], $this->mpdf->PDFAXwarnings); - if ($cor{0} == 1) { + if ($cor[0] == 1) { $g['colorspace'] = 'Gray'; - } elseif ($cor{0} == 4 || $cor{0} == 6) { + } elseif ($cor[0] == 4 || $cor[0] == 6) { $g['colorspace'] = 'CMYK'; } if ($cor) { diff --git a/vendor/mpdf/mpdf/src/Image/ImageProcessor.php b/vendor/mpdf/mpdf/src/Image/ImageProcessor.php index 8bdf0af..60a4304 100644 --- a/vendor/mpdf/mpdf/src/Image/ImageProcessor.php +++ b/vendor/mpdf/mpdf/src/Image/ImageProcessor.php @@ -9,6 +9,8 @@ use Mpdf\CssManager; +use Mpdf\File\StreamWrapperChecker; + use Mpdf\Gif\Gif; use Mpdf\Language\LanguageToFontInterface; @@ -151,11 +153,12 @@ public function setLogger(LoggerInterface $logger) public function getImage(&$file, $firsttime = true, $allowvector = true, $orig_srcpath = false, $interpolation = false) { /** - * Prevents insecure PHP deserialization through phar:// wrapper + * Prevents insecure PHP object injection through phar:// wrapper * @see https://github.com/mpdf/mpdf/issues/949 */ - if ($this->hasBlacklistedStreamWrapper($file)) { - return $this->imageError($file, $firsttime, 'File contains an invalid stream. Only http://, https://, and file:// streams are valid.'); + $wrapperChecker = new StreamWrapperChecker($this->mpdf); + if ($wrapperChecker->hasBlacklistedStreamWrapper($file)) { + return $this->imageError($file, $firsttime, 'File contains an invalid stream. Only ' . implode(', ', $wrapperChecker->getWhitelistedStreamWrappers()) . ' streams are allowed.'); } // mPDF 6 @@ -173,7 +176,7 @@ public function getImage(&$file, $firsttime = true, $allowvector = true, $orig_s $file = md5($data); } - if (preg_match('/data:image\/(gif|jpeg|png);base64,(.*)/', $file, $v)) { + if (preg_match('/data:image\/(gif|jpe?g|png);base64,(.*)/', $file, $v)) { $type = $v[1]; $data = base64_decode($v[2]); $file = md5($data); @@ -586,7 +589,7 @@ public function getImage(&$file, $firsttime = true, $allowvector = true, $orig_s if ($p) { $n = $this->fourBytesToInt(substr($data, $p - 4, 4)); $transparency = substr($data, $p + 4, $n); - // ord($transparency{$index}) = the alpha value for that index + // ord($transparency[$index]) = the alpha value for that index // generate alpha channel for ($ypx = 0; $ypx < $h; ++$ypx) { for ($xpx = 0; $xpx < $w; ++$xpx) { @@ -594,7 +597,7 @@ public function getImage(&$file, $firsttime = true, $allowvector = true, $orig_s if ($colorindex >= $n) { $alpha = 255; } else { - $alpha = ord($transparency{$colorindex}); + $alpha = ord($transparency[$colorindex]); } // 0-255 if ($alpha > 0) { imagesetpixel($imgalpha, $xpx, $ypx, $alpha); @@ -1103,7 +1106,7 @@ private function convertImage(&$data, $colspace, $targetcs, $w, $h, $dpi, $mask, if ($p) { $n = $this->fourBytesToInt(substr($data, $p - 4, 4)); $transparency = substr($data, $p + 4, $n); - // ord($transparency{$index}) = the alpha value for that index + // ord($transparency[$index]) = the alpha value for that index // generate alpha channel for ($ypx = 0; $ypx < $h; ++$ypx) { for ($xpx = 0; $xpx < $w; ++$xpx) { @@ -1111,7 +1114,7 @@ private function convertImage(&$data, $colspace, $targetcs, $w, $h, $dpi, $mask, if ($colorindex >= $n) { $alpha = 255; } else { - $alpha = ord($transparency{$colorindex}); + $alpha = ord($transparency[$colorindex]); } // 0-255 $mimgdata .= chr($alpha); } @@ -1313,13 +1316,13 @@ private function jpgHeaderFromString(&$data) $p += $this->twoBytesToInt(substr($data, $p, 2)); // Length of initial marker block $marker = substr($data, $p, 2); - while ($marker !== chr(255) . chr(192) && $marker !== chr(255) . chr(194) && $p < strlen($data)) { - // Start of frame marker (FFC0) or (FFC2) mPDF 4.4.004 + while ($marker !== chr(255) . chr(192) && $marker !== chr(255) . chr(194) && $marker !== chr(255) . chr(193) && $p < strlen($data)) { + // Start of frame marker (FFC0) (FFC1) or (FFC2) $p += $this->twoBytesToInt(substr($data, $p + 2, 2)) + 2; // Length of marker block $marker = substr($data, $p, 2); } - if ($marker !== chr(255) . chr(192) && $marker !== chr(255) . chr(194)) { + if ($marker !== chr(255) . chr(192) && $marker !== chr(255) . chr(194) && $marker !== chr(255) . chr(193)) { return false; } return substr($data, $p + 2, 10); @@ -1403,7 +1406,7 @@ private function imageError($file, $firsttime, $msg) $this->failedImages[$file] = true; if ($firsttime && ($this->mpdf->showImageErrors || $this->mpdf->debug)) { - throw new \Mpdf\MpdfImageException(sprintf('%s (%s)', $msg, $file)); + throw new \Mpdf\MpdfImageException(sprintf('%s (%s)', $msg, substr($file, 0, 256))); } $this->logger->warning(sprintf('%s (%s)', $msg, $file), ['context' => LogContext::IMAGES]); @@ -1429,27 +1432,4 @@ private function urldecodeParts($url) return $file . $query; } - /** - * @param string $filename - * @return bool - * @since 7.1.8 - */ - private function hasBlacklistedStreamWrapper($filename) - { - if (strpos($filename, '://') > 0) { - $wrappers = stream_get_wrappers(); - foreach ($wrappers as $wrapper) { - if (in_array($wrapper, ['http', 'https', 'file'])) { - continue; - } - - if (stripos($filename, $wrapper . '://') === 0) { - return true; - } - } - } - - return false; - } - } diff --git a/vendor/mpdf/mpdf/src/Image/Svg.php b/vendor/mpdf/mpdf/src/Image/Svg.php index baa4829..f514700 100644 --- a/vendor/mpdf/mpdf/src/Image/Svg.php +++ b/vendor/mpdf/mpdf/src/Image/Svg.php @@ -310,7 +310,7 @@ function svgImage($attribs) } else { // the entire viewport is covered by the viewBox $img_h = $img_w * $info['h'] / $info['w']; } - } else if ($info['h'] / $info['w'] < $h / $w) { + } elseif ($info['h'] / $info['w'] < $h / $w) { if ($meetOrSlice == 'meet') { // the entire viewBox is visible within the viewport $img_h = $img_w * $info['h'] / $info['w']; } else { // the entire viewport is covered by the viewBox @@ -320,25 +320,25 @@ function svgImage($attribs) if ($ar[0] == 'xminymin') { // do nothing to x // do nothing to y - } else if ($ar[0] == 'xmidymin') { + } elseif ($ar[0] == 'xmidymin') { $img_x += $w / 2 - $img_w / 2; // xMid // do nothing to y - } else if ($ar[0] == 'xmaxymin') { + } elseif ($ar[0] == 'xmaxymin') { $img_x += $w - $img_w; // xMax // do nothing to y - } else if ($ar[0] == 'xminymid') { + } elseif ($ar[0] == 'xminymid') { // do nothing to x $img_y += $h / 2 - $img_h / 2; // yMid - } else if ($ar[0] == 'xmaxymid') { + } elseif ($ar[0] == 'xmaxymid') { $img_x += $w - $img_w; // xMax $img_y += $h / 2 - $img_h / 2; // yMid - } else if ($ar[0] == 'xminymax') { + } elseif ($ar[0] == 'xminymax') { // do nothing to x $img_y += $h - $img_h; // yMax - } else if ($ar[0] == 'xmidymax') { + } elseif ($ar[0] == 'xmidymax') { $img_x += $w / 2 - $img_w / 2; // xMid $img_y += $h - $img_h; // yMax - } else if ($ar[0] == 'xmaxymax') { + } elseif ($ar[0] == 'xmaxymax') { $img_x += $w - $img_w; // xMax $img_y += $h - $img_h; // yMax } else { // xMidYMid (the default) @@ -381,17 +381,17 @@ function svgGradient($gradient_info, $attribs, $element) $h = $attribs['height']; $x_offset = $attribs['x']; $y_offset = $attribs['y']; - } else if ($element == 'ellipse') { + } elseif ($element == 'ellipse') { $w = $attribs['rx'] * 2; $h = $attribs['ry'] * 2; $x_offset = $attribs['cx'] - $attribs['rx']; $y_offset = $attribs['cy'] - $attribs['ry']; - } else if ($element == 'circle') { + } elseif ($element == 'circle') { $w = $attribs['r'] * 2; $h = $attribs['r'] * 2; $x_offset = $attribs['cx'] - $attribs['r']; $y_offset = $attribs['cy'] - $attribs['r']; - } else if ($element == 'polygon') { + } elseif ($element == 'polygon') { $pts = preg_split('/[ ,]+/', trim($attribs['points'])); $maxr = $maxb = 0; $minl = $mint = 999999; @@ -408,7 +408,7 @@ function svgGradient($gradient_info, $attribs, $element) $h = $maxb - $mint; $x_offset = $minl; $y_offset = $mint; - } else if ($element == 'path') { + } elseif ($element == 'path') { if (is_array($this->pathBBox) && $this->pathBBox[2] > 0) { $w = $this->pathBBox[2]; $h = $this->pathBBox[3]; @@ -475,7 +475,7 @@ function svgGradient($gradient_info, $attribs, $element) // Note angle of rotation is reversed (from SVG to PDF), so vv[1] and vv[2] are negated // cf svgDefineStyle() $transformations .= sprintf(' %.3F %.3F %.3F %.3F %.3F %.3F cm ', $vv[0], -$vv[1], -$vv[2], $vv[3], $vv[4] * $this->kp, -$vv[5] * $this->kp); - } else if ($c == 'translate' && count($vv)) { + } elseif ($c == 'translate' && count($vv)) { $tm[4] = $vv[0]; if (count($vv) == 2) { $t_y = -$vv[1]; @@ -484,7 +484,7 @@ function svgGradient($gradient_info, $attribs, $element) } $tm[5] = $t_y; $transformations .= sprintf(' 1 0 0 1 %.3F %.3F cm ', $tm[4] * $this->kp, $tm[5] * $this->kp); - } else if ($c == 'scale' && count($vv)) { + } elseif ($c == 'scale' && count($vv)) { if (count($vv) == 2) { $s_y = $vv[1]; } else { @@ -493,7 +493,7 @@ function svgGradient($gradient_info, $attribs, $element) $tm[0] = $vv[0]; $tm[3] = $s_y; $transformations .= sprintf(' %.3F 0 0 %.3F 0 0 cm ', $tm[0], $tm[3]); - } else if ($c == 'rotate' && count($vv)) { + } elseif ($c == 'rotate' && count($vv)) { $tm[0] = cos(deg2rad(-$vv[0])); $tm[1] = sin(deg2rad(-$vv[0])); $tm[2] = -$tm[1]; @@ -505,10 +505,10 @@ function svgGradient($gradient_info, $attribs, $element) if (count($vv) == 3) { $transformations .= sprintf(' 1 0 0 1 %.3F %.3F cm ', -$vv[1] * $this->kp, $vv[2] * $this->kp); } - } else if ($c == 'skewx' && count($vv)) { + } elseif ($c == 'skewx' && count($vv)) { $tm[2] = tan(deg2rad(-$vv[0])); $transformations .= sprintf(' 1 0 %.3F 1 0 0 cm ', $tm[2]); - } else if ($c == 'skewy' && count($vv)) { + } elseif ($c == 'skewy' && count($vv)) { $tm[1] = tan(deg2rad(-$vv[0])); $transformations .= sprintf(' 1 %.3F 0 1 0 0 cm ', $tm[1]); } @@ -529,7 +529,7 @@ function svgGradient($gradient_info, $attribs, $element) if (strtolower($gradient_info['spread']) == 'reflect') { $spread = 'F'; } // reflect - else if (strtolower($gradient_info['spread']) == 'repeat') { + elseif (strtolower($gradient_info['spread']) == 'repeat') { $spread = 'R'; } // repeat } @@ -630,7 +630,7 @@ function svgGradient($gradient_info, $attribs, $element) $angle = rad2deg(atan2(($gradient_info['info']['y2'] - $gradient_info['info']['y1']), ($gradient_info['info']['x2'] - $gradient_info['info']['x1']))); if ($angle < 0) { $angle += 360; - } else if ($angle > 360) { + } elseif ($angle > 360) { $angle -= 360; } if ($angle != 0 && $angle != 360 && $angle != 90 && $angle != 180 && $angle != 270) { @@ -765,9 +765,9 @@ function svgGradient($gradient_info, $attribs, $element) if (!$gradient_info['color'][$i]['color']) { if ($gradient_info['colorspace'] == 'RGB') { $gradient_info['color'][$i]['color'] = '0 0 0'; - } else if ($gradient_info['colorspace'] == 'Gray') { + } elseif ($gradient_info['colorspace'] == 'Gray') { $gradient_info['color'][$i]['color'] = '0'; - } else if ($gradient_info['colorspace'] == 'CMYK') { + } elseif ($gradient_info['colorspace'] == 'CMYK') { $gradient_info['color'][$i]['color'] = '1 1 1 1'; } } @@ -799,7 +799,7 @@ function svgGradient($gradient_info, $attribs, $element) } $return .= ' /Sh' . ($n) . ' sh '; $return .= " Q\n"; - } else if ($gradient_info['type'] == 'radial') { + } elseif ($gradient_info['type'] == 'radial') { if (isset($gradient_info['units']) && strtolower($gradient_info['units']) == 'userspaceonuse') { if ($w > $h) { $h = $w; @@ -838,14 +838,14 @@ function svgGradient($gradient_info, $attribs, $element) } if (isset($gradient_info['info']['rx'])) { $rx = $gradient_info['info']['rx']; - } else if (isset($gradient_info['info']['r'])) { + } elseif (isset($gradient_info['info']['r'])) { $rx = $gradient_info['info']['r']; } else { $rx = 0.5; } if (isset($gradient_info['info']['ry'])) { $ry = $gradient_info['info']['ry']; - } else if (isset($gradient_info['info']['r'])) { + } elseif (isset($gradient_info['info']['r'])) { $ry = $gradient_info['info']['r']; } else { $ry = 0.5; @@ -899,7 +899,7 @@ function svgGradient($gradient_info, $attribs, $element) if ($angle < 0) { $angle += 360; - } else if ($angle > 360) { + } elseif ($angle > 360) { $angle -= 360; } @@ -994,9 +994,9 @@ function svgGradient($gradient_info, $attribs, $element) if (!$gradient_info['color'][$i]['color']) { if ($gradient_info['colorspace'] == 'RGB') { $gradient_info['color'][$i]['color'] = '0 0 0'; - } else if ($gradient_info['colorspace'] == 'Gray') { + } elseif ($gradient_info['colorspace'] == 'Gray') { $gradient_info['color'][$i]['color'] = '0'; - } else if ($gradient_info['colorspace'] == 'CMYK') { + } elseif ($gradient_info['colorspace'] == 'CMYK') { $gradient_info['color'][$i]['color'] = '1 1 1 1'; } } @@ -1065,7 +1065,7 @@ function svgOffset($attribs) if ($svg_w) { // if width also set, use these values to determine to set size of "pixel" $this->kp *= ($svg_w / 0.2645) / $this->svg_info['w']; $this->kf = ($svg_w / 0.2645) / $this->svg_info['w']; - } else if ($svg_h) { + } elseif ($svg_h) { $this->kp *= ($svg_h / 0.2645) / $this->svg_info['h']; $this->kf = ($svg_h / 0.2645) / $this->svg_info['h']; } @@ -1172,7 +1172,7 @@ function svgDefineStyle($critere_style) // $transformations .= sprintf(' %.3F %.3F %.3F %.3F %.3F %.3F cm ', $ma, $mb, $mc, $md, $vv[4]*$this->kp, -$vv[5]*$this->kp); */ - } else if ($c == 'translate' && count($vv)) { + } elseif ($c == 'translate' && count($vv)) { $tm[4] = $vv[0]; if (count($vv) == 2) { $t_y = -$vv[1]; @@ -1181,7 +1181,7 @@ function svgDefineStyle($critere_style) } $tm[5] = $t_y; $transformations .= sprintf(' 1 0 0 1 %.3F %.3F cm ', $tm[4] * $this->kp, $tm[5] * $this->kp); - } else if ($c == 'scale' && count($vv)) { + } elseif ($c == 'scale' && count($vv)) { if (count($vv) == 2) { $s_y = $vv[1]; } else { @@ -1190,7 +1190,7 @@ function svgDefineStyle($critere_style) $tm[0] = $vv[0]; $tm[3] = $s_y; $transformations .= sprintf(' %.3F 0 0 %.3F 0 0 cm ', $tm[0], $tm[3]); - } else if ($c == 'rotate' && count($vv)) { + } elseif ($c == 'rotate' && count($vv)) { $tm[0] = cos(deg2rad(-$vv[0])); $tm[1] = sin(deg2rad(-$vv[0])); $tm[2] = -$tm[1]; @@ -1202,10 +1202,10 @@ function svgDefineStyle($critere_style) if (count($vv) == 3) { $transformations .= sprintf(' 1 0 0 1 %.3F %.3F cm ', -$vv[1] * $this->kp, $vv[2] * $this->kp); } - } else if ($c == 'skewx' && count($vv)) { + } elseif ($c == 'skewx' && count($vv)) { $tm[2] = tan(deg2rad(-$vv[0])); $transformations .= sprintf(' 1 0 %.3F 1 0 0 cm ', $tm[2]); - } else if ($c == 'skewy' && count($vv)) { + } elseif ($c == 'skewy' && count($vv)) { $tm[1] = tan(deg2rad(-$vv[0])); $transformations .= sprintf(' 1 %.3F 0 1 0 0 cm ', $tm[1]); } @@ -1366,26 +1366,26 @@ function svgStyle($critere_style, $attribs, $element) } } } // Used as indirect setting for currentColor - else if (strtolower($critere_style['fill']) == 'currentcolor' && $element != 'line') { + elseif (strtolower($critere_style['fill']) == 'currentcolor' && $element != 'line') { $col = $this->colorConverter->convert($critere_style['color'], $this->mpdf->PDFAXwarnings); if ($col) { - if ($col{0} == 5) { - $critere_style['fill-opacity'] = ord($col{4} / 100); + if ($col[0] == 5 && is_numeric($col[4])) { + $critere_style['fill-opacity'] = ord($col[4] / 100); } // RGBa - if ($col{0} == 6) { - $critere_style['fill-opacity'] = ord($col{5} / 100); + if ($col[0] == 6 && is_numeric($col[5])) { + $critere_style['fill-opacity'] = ord($col[5] / 100); } // CMYKa $path_style .= $this->mpdf->SetFColor($col, true) . ' '; $style .= 'F'; } - } else if ($critere_style['fill'] != 'none' && $element != 'line') { + } elseif ($critere_style['fill'] != 'none' && $element != 'line') { $col = $this->colorConverter->convert($critere_style['fill'], $this->mpdf->PDFAXwarnings); if ($col) { - if ($col{0} == 5) { - $critere_style['fill-opacity'] = ord($col{4} / 100); + if ($col[0] == 5 && is_numeric($col[4])) { + $critere_style['fill-opacity'] = ord($col[4] / 100); } // RGBa - if ($col{0} == 6) { - $critere_style['fill-opacity'] = ord($col{5} / 100); + if ($col[0] == 6 && is_numeric($col[5])) { + $critere_style['fill-opacity'] = ord($col[5] / 100); } // CMYKa $path_style .= $this->mpdf->SetFColor($col, true) . ' '; $style .= 'F'; @@ -1407,30 +1407,30 @@ function svgStyle($critere_style, $attribs, $element) } */ } // Used as indirect setting for currentColor - else if (strtolower($critere_style['stroke']) == 'currentcolor') { + elseif (strtolower($critere_style['stroke']) == 'currentcolor') { $col = $this->colorConverter->convert($critere_style['color'], $this->mpdf->PDFAXwarnings); if ($col) { - if ($col{0} == 5) { - $critere_style['stroke-opacity'] = ord($col{4} / 100); + if ($col[0] == 5 && is_numeric($col[4])) { + $critere_style['stroke-opacity'] = ord($col[4] / 100); } // RGBa - if ($col{0} == 6) { - $critere_style['stroke-opacity'] = ord($col{5} / 100); + if ($col[0] == 6 && is_numeric($col[5])) { + $critere_style['stroke-opacity'] = ord($col[5] / 100); } // CMYKa $path_style .= $this->mpdf->SetDColor($col, true) . ' '; $style .= 'D'; $lw = $this->ConvertSVGSizePixels($critere_style['stroke-width']); $path_style .= sprintf('%.3F w ', $lw * $this->kp); } - } else if ($critere_style['stroke'] != 'none') { + } elseif ($critere_style['stroke'] != 'none') { $col = $this->colorConverter->convert($critere_style['stroke'], $this->mpdf->PDFAXwarnings); if ($col) { // mPDF 5.0.051 // mPDF 5.3.74 - if ($col{0} == 5) { - $critere_style['stroke-opacity'] = ord($col{4} / 100); + if ($col[0] == 5 && is_numeric($col[4])) { + $critere_style['stroke-opacity'] = ord($col[4] / 100); } // RGBa - if ($col{0} == 6) { - $critere_style['stroke-opacity'] = ord($col{5} / 100); + if ($col[0] == 6 && is_numeric($col[5])) { + $critere_style['stroke-opacity'] = ord($col[5] / 100); } // CMYKa $path_style .= $this->mpdf->SetDColor($col, true) . ' '; $style .= 'D'; @@ -1443,23 +1443,23 @@ function svgStyle($critere_style, $attribs, $element) if ($critere_style['stroke'] != 'none') { if ($critere_style['stroke-linejoin'] == 'miter') { $path_style .= ' 0 j '; - } else if ($critere_style['stroke-linejoin'] == 'round') { + } elseif ($critere_style['stroke-linejoin'] == 'round') { $path_style .= ' 1 j '; - } else if ($critere_style['stroke-linejoin'] == 'bevel') { + } elseif ($critere_style['stroke-linejoin'] == 'bevel') { $path_style .= ' 2 j '; } if ($critere_style['stroke-linecap'] == 'butt') { $path_style .= ' 0 J '; - } else if ($critere_style['stroke-linecap'] == 'round') { + } elseif ($critere_style['stroke-linecap'] == 'round') { $path_style .= ' 1 J '; - } else if ($critere_style['stroke-linecap'] == 'square') { + } elseif ($critere_style['stroke-linecap'] == 'square') { $path_style .= ' 2 J '; } if (isset($critere_style['stroke-miterlimit'])) { if ($critere_style['stroke-miterlimit'] == 'none') { - } else if (preg_match('/^[\d.]+$/', $critere_style['stroke-miterlimit'])) { + } elseif (preg_match('/^[\d.]+$/', $critere_style['stroke-miterlimit'])) { $path_style .= sprintf('%.2F M ', $critere_style['stroke-miterlimit']); } } @@ -1494,11 +1494,11 @@ function svgStyle($critere_style, $attribs, $element) $opacity = 1; if ($critere_style['fill-opacity'] == 0) { $opacity = 0; - } else if ($critere_style['fill-opacity'] > 1) { + } elseif ($critere_style['fill-opacity'] > 1) { $opacity = 1; - } else if ($critere_style['fill-opacity'] > 0) { + } elseif ($critere_style['fill-opacity'] > 0) { $opacity = $critere_style['fill-opacity']; - } else if ($critere_style['fill-opacity'] < 0) { + } elseif ($critere_style['fill-opacity'] < 0) { $opacity = 0; } $gs = $this->mpdf->AddExtGState(['ca' => $opacity, 'BM' => '/Normal']); @@ -1510,11 +1510,11 @@ function svgStyle($critere_style, $attribs, $element) $opacity = 1; if ($critere_style['stroke-opacity'] == 0) { $opacity = 0; - } else if ($critere_style['stroke-opacity'] > 1) { + } elseif ($critere_style['stroke-opacity'] > 1) { $opacity = 1; - } else if ($critere_style['stroke-opacity'] > 0) { + } elseif ($critere_style['stroke-opacity'] > 0) { $opacity = $critere_style['stroke-opacity']; - } else if ($critere_style['stroke-opacity'] < 0) { + } elseif ($critere_style['stroke-opacity'] < 0) { $opacity = 0; } $gs = $this->mpdf->AddExtGState(['CA' => $opacity, 'BM' => '/Normal']); @@ -1997,7 +1997,7 @@ function Arcto($x1, $y1, $x2, $y2, $rx, $ry, $angle, $largeArcFlag, $sweepFlag) $dtheta = $this->CalcVectorAngle(($x1dash - $cxdash) / $rx, ($y1dash - $cydash) / $ry, (-$x1dash - $cxdash) / $rx, (-$y1dash - $cydash) / $ry); if (!$sweepFlag && $dtheta > 0) { $dtheta -= 2.0 * M_PI; - } else if ($sweepFlag && $dtheta < 0) { + } elseif ($sweepFlag && $dtheta < 0) { $dtheta += 2.0 * M_PI; } @@ -2070,7 +2070,7 @@ function ConvertSVGSizePixels($size = 5, $maxsize = 'x') if ($maxsize == 'y') { $maxsize = $this->svg_info['h']; - } else if ($maxsize == 'x') { + } elseif ($maxsize == 'x') { $maxsize = $this->svg_info['w']; } $maxsize *= (25.4 / $this->mpdf->dpi); // convert pixels to mm @@ -2260,7 +2260,7 @@ function svgText() $fontsize = $current_style['font-size'] * $this->mpdf->dpi / 72; if (isset($this->svg_font[$current_style['font-family']][$style])) { $svg_font = $this->svg_font[$current_style['font-family']][$style]; - } else if (isset($this->svg_font[$current_style['font-family']]['R'])) { + } elseif (isset($this->svg_font[$current_style['font-family']]['R'])) { $svg_font = $this->svg_font[$current_style['font-family']]['R']; } @@ -2277,11 +2277,11 @@ function svgText() if (isset($current_style['fill-opacity'])) { if ($current_style['fill-opacity'] == 0) { $fopacity = 0; - } else if ($current_style['fill-opacity'] > 1) { + } elseif ($current_style['fill-opacity'] > 1) { $fopacity = 1; - } else if ($current_style['fill-opacity'] > 0) { + } elseif ($current_style['fill-opacity'] > 0) { $fopacity = $current_style['fill-opacity']; - } else if ($current_style['fill-opacity'] < 0) { + } elseif ($current_style['fill-opacity'] < 0) { $fopacity = 0; } } @@ -2289,11 +2289,11 @@ function svgText() if (isset($current_style['stroke-opacity'])) { if ($current_style['stroke-opacity'] == 0) { $sopacity = 0; - } else if ($current_style['stroke-opacity'] > 1) { + } elseif ($current_style['stroke-opacity'] > 1) { $sopacity = 1; - } else if ($current_style['stroke-opacity'] > 0) { + } elseif ($current_style['stroke-opacity'] > 0) { $sopacity = $current_style['stroke-opacity']; - } else if ($current_style['stroke-opacity'] < 0) { + } elseif ($current_style['stroke-opacity'] < 0) { $sopacity = 0; } } @@ -2434,11 +2434,11 @@ function svgText() if (isset($current_style['fill-opacity'])) { if ($current_style['fill-opacity'] == 0) { $fopacity = 0; - } else if ($current_style['fill-opacity'] > 1) { + } elseif ($current_style['fill-opacity'] > 1) { $fopacity = 1; - } else if ($current_style['fill-opacity'] > 0) { + } elseif ($current_style['fill-opacity'] > 0) { $fopacity = $current_style['fill-opacity']; - } else if ($current_style['fill-opacity'] < 0) { + } elseif ($current_style['fill-opacity'] < 0) { $fopacity = 0; } } @@ -2446,11 +2446,11 @@ function svgText() if (isset($current_style['stroke-opacity'])) { if ($current_style['stroke-opacity'] == 0) { $sopacity = 0; - } else if ($current_style['stroke-opacity'] > 1) { + } elseif ($current_style['stroke-opacity'] > 1) { $sopacity = 1; - } else if ($current_style['stroke-opacity'] > 0) { + } elseif ($current_style['stroke-opacity'] > 0) { $sopacity = $current_style['stroke-opacity']; - } else if ($current_style['stroke-opacity'] < 0) { + } elseif ($current_style['stroke-opacity'] < 0) { $sopacity = 0; } } @@ -3086,7 +3086,7 @@ function markScriptToLang($html) if ($scriptblock == 0) { $scriptblock = $sbl; $scriptblocks[$subchunk] = $scriptblock; - } else if ($scriptblock > 0 && $scriptblock != $sbl) { + } elseif ($scriptblock > 0 && $scriptblock != $sbl) { // NEW (non-common) Script encountered in this chunk. // Start a new subchunk $subchunk++; @@ -3136,20 +3136,20 @@ function markScriptToLang($html) if ($scriptblocks[$sch] == Ucdn::SCRIPT_LATIN && $this->mpdf->autoVietnamese && preg_match("/([" . $this->scriptToLanguage->getLanguageDelimiters('viet') . "])/u", $s)) { $lang = "vi"; } // Check Arabic for different languages if Arabic script - even if Basescript - else if ($scriptblocks[$sch] == Ucdn::SCRIPT_ARABIC && $this->mpdf->autoArabic) { + elseif ($scriptblocks[$sch] == Ucdn::SCRIPT_ARABIC && $this->mpdf->autoArabic) { if (preg_match("/[" . $this->scriptToLanguage->getLanguageDelimiters('sindhi') . "]/u", $s)) { $lang = "sd"; - } else if (preg_match("/[" . $this->scriptToLanguage->getLanguageDelimiters('urdu') . "]/u", $s)) { + } elseif (preg_match("/[" . $this->scriptToLanguage->getLanguageDelimiters('urdu') . "]/u", $s)) { $lang = "ur"; - } else if (preg_match("/[" . $this->scriptToLanguage->getLanguageDelimiters('pashto') . "]/u", $s)) { + } elseif (preg_match("/[" . $this->scriptToLanguage->getLanguageDelimiters('pashto') . "]/u", $s)) { $lang = "ps"; - } else if (preg_match("/[" . $this->scriptToLanguage->getLanguageDelimiters('persian') . "]/u", $s)) { + } elseif (preg_match("/[" . $this->scriptToLanguage->getLanguageDelimiters('persian') . "]/u", $s)) { $lang = "fa"; - } else if ($this->mpdf->baseScript != Ucdn::SCRIPT_ARABIC && $this->scriptToLanguage->getLanguageByScript($scriptblocks[$sch])) { + } elseif ($this->mpdf->baseScript != Ucdn::SCRIPT_ARABIC && $this->scriptToLanguage->getLanguageByScript($scriptblocks[$sch])) { $lang = "'." . $this->scriptToLanguage->getLanguageByScript($scriptblocks[$sch]) . "'"; } } // Identify Script block if not Basescript, and mark up as language - else if ($scriptblocks[$sch] > 0 && $scriptblocks[$sch] != $this->mpdf->baseScript && $this->scriptToLanguage->getLanguageByScript($scriptblocks[$sch])) { + elseif ($scriptblocks[$sch] > 0 && $scriptblocks[$sch] != $this->mpdf->baseScript && $this->scriptToLanguage->getLanguageByScript($scriptblocks[$sch])) { $lang = $this->scriptToLanguage->getLanguageByScript($scriptblocks[$sch]); } if ($lang) { @@ -3180,7 +3180,7 @@ function xml_svg2pdf_start($parser, $name, $attribs) } return; } // mPDF 6 - else if (strtolower($name) == 'font-face') { + elseif (strtolower($name) == 'font-face') { $last_svg_fontstyle = 'R'; $last_svg_fontstyle .= (isset($attribs['font-weight']) && $attribs['font-weight'] == 'bold') ? 'B' : ''; $last_svg_fontstyle .= (isset($attribs['font-style']) && $attribs['font-style'] == 'italic') ? 'I' : ''; @@ -3202,14 +3202,14 @@ function xml_svg2pdf_start($parser, $name, $attribs) } return; } // mPDF 6 - else if (strtolower($name) == 'missing-glyph') { + elseif (strtolower($name) == 'missing-glyph') { if ($last_svg_fontid && isset($attribs['horiz-adv-x'])) { $this->svg_font[$last_svg_fontid][$last_svg_fontstyle]['horiz-adv-x'] = (isset($attribs['horiz-adv-x']) ? $attribs['horiz-adv-x'] : ''); $this->svg_font[$last_svg_fontid][$last_svg_fontstyle]['d'] = (isset($attribs['d']) ? $attribs['d'] : ''); } return; } // mPDF 6 - else if (strtolower($name) == 'glyph') { + elseif (strtolower($name) == 'glyph') { if ($last_svg_fontid && isset($attribs['unicode'])) { $this->svg_font[$last_svg_fontid][$last_svg_fontstyle]['glyphs'][$attribs['unicode']] = [ 'horiz-adv-x' => (isset($attribs['horiz-adv-x']) ? $attribs['horiz-adv-x'] : $last_svg_fontdefw), @@ -3218,7 +3218,7 @@ function xml_svg2pdf_start($parser, $name, $attribs) } return; } // mPDF 5.7.2 - else if (strtolower($name) == 'lineargradient') { + elseif (strtolower($name) == 'lineargradient') { $tmp_gradient = [ 'type' => 'linear', 'transform' => (isset($attribs['gradientTransform']) ? $attribs['gradientTransform'] : ''), @@ -3241,7 +3241,7 @@ function xml_svg2pdf_start($parser, $name, $attribs) $last_gradid = $attribs['id']; $this->svgAddGradient($attribs['id'], $tmp_gradient); return; - } else if (strtolower($name) == 'radialgradient') { + } elseif (strtolower($name) == 'radialgradient') { $tmp_gradient = [ 'type' => 'radial', 'transform' => (isset($attribs['gradientTransform']) ? $attribs['gradientTransform'] : ''), @@ -3267,40 +3267,40 @@ function xml_svg2pdf_start($parser, $name, $attribs) $last_gradid = $attribs['id']; $this->svgAddGradient($attribs['id'], $tmp_gradient); return; - } else if (strtolower($name) == 'stop') { + } elseif (strtolower($name) == 'stop') { if (!$last_gradid) { return; } $color = '#000000'; if (isset($attribs['style']) and preg_match('/stop-color:\s*([^;]*)/i', $attribs['style'], $m)) { $color = trim($m[1]); - } else if (isset($attribs['stop-color']) && $attribs['stop-color']) { + } elseif (isset($attribs['stop-color']) && $attribs['stop-color']) { $color = $attribs['stop-color']; } $col = $this->colorConverter->convert($color, $this->mpdf->PDFAXwarnings); if (!$col) { $col = $this->colorConverter->convert('#000000', $this->mpdf->PDFAXwarnings); } // In case "transparent" or "inherit" returned - if ($col{0} == 3 || $col{0} == 5) { // RGB - $color_final = sprintf('%.3F %.3F %.3F', ord($col{1}) / 255, ord($col{2}) / 255, ord($col{3}) / 255); + if ($col[0] == 3 || $col[0] == 5) { // RGB + $color_final = sprintf('%.3F %.3F %.3F', ord($col[1]) / 255, ord($col[2]) / 255, ord($col[3]) / 255); $this->svg_gradient[$last_gradid]['colorspace'] = 'RGB'; - } else if ($col{0} == 4 || $col{0} == 6) { // CMYK - $color_final = sprintf('%.3F %.3F %.3F %.3F', ord($col{1}) / 100, ord($col{2}) / 100, ord($col{3}) / 100, ord($col{4}) / 100); + } elseif ($col[0] == 4 || $col[0] == 6) { // CMYK + $color_final = sprintf('%.3F %.3F %.3F %.3F', ord($col[1]) / 100, ord($col[2]) / 100, ord($col[3]) / 100, ord($col[4]) / 100); $this->svg_gradient[$last_gradid]['colorspace'] = 'CMYK'; - } else if ($col{0} == 1) { // Grayscale - $color_final = sprintf('%.3F', ord($col{1}) / 255); + } elseif ($col[0] == 1) { // Grayscale + $color_final = sprintf('%.3F', ord($col[1]) / 255); $this->svg_gradient[$last_gradid]['colorspace'] = 'Gray'; } $stop_opacity = 1; if (isset($attribs['style']) and preg_match('/stop-opacity:\s*([0-9.]*)/i', $attribs['style'], $m)) { $stop_opacity = $m[1]; - } else if (isset($attribs['stop-opacity'])) { + } elseif (isset($attribs['stop-opacity'])) { $stop_opacity = $attribs['stop-opacity']; - } else if ($col{0} == 5) { // RGBa - $stop_opacity = ord($col{4} / 100); - } else if ($col{0} == 6) { // CMYKa - $stop_opacity = ord($col{5} / 100); + } elseif ($col[0] == 5) { // RGBa + $stop_opacity = ord($col[4] / 100); + } elseif ($col[0] == 6) { // CMYKa + $stop_opacity = ord($col[5] / 100); } $tmp_color = [ @@ -3640,7 +3640,7 @@ function xml_svg2pdf_start($parser, $name, $attribs) // If text-anchor middle|end, adjust if ($this->textanchor == 'end') { $tx = -$this->texttotallength; - } else if ($this->textanchor == 'middle') { + } elseif ($this->textanchor == 'middle') { $tx = -$this->texttotallength / 2; } else { $tx = 0; @@ -3803,7 +3803,7 @@ function xml_svg2pdf_end($parser, $name) // If text-anchor middle|end, adjust if ($this->textanchor == 'end') { $tx = -$this->texttotallength; - } else if ($this->textanchor == 'middle') { + } elseif ($this->textanchor == 'middle') { $tx = -$this->texttotallength / 2; } else { $tx = 0; diff --git a/vendor/mpdf/mpdf/src/Image/Wmf.php b/vendor/mpdf/mpdf/src/Image/Wmf.php index 10342ab..36b2a97 100644 --- a/vendor/mpdf/mpdf/src/Image/Wmf.php +++ b/vendor/mpdf/mpdf/src/Image/Wmf.php @@ -182,7 +182,7 @@ function _getWMFimage($data) } if ($func == 0x0325) { $op = 's'; - } else if ($func == 0x0324) { + } elseif ($func == 0x0324) { if ($nullPen) { if ($nullBrush) { $op = 'n'; diff --git a/vendor/mpdf/mpdf/src/Mpdf.php b/vendor/mpdf/mpdf/src/Mpdf.php index b536c1c..4c34572 100644 --- a/vendor/mpdf/mpdf/src/Mpdf.php +++ b/vendor/mpdf/mpdf/src/Mpdf.php @@ -39,7 +39,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface use Strict; use FpdiTrait; - const VERSION = '8.0.0'; + const VERSION = '8.0.6'; const SCALE = 72 / 25.4; @@ -190,6 +190,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface var $allow_html_optional_endtags; var $img_dpi; + var $whitelistStreamWrappers; var $defaultheaderfontsize; var $defaultheaderfontstyle; @@ -700,6 +701,24 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface */ var $curlAllowUnsafeSslRequests; + /** + * Set the proxy for cURL. + * + * @see https://curl.haxx.se/libcurl/c/CURLOPT_PROXY.html + * + * @var string + */ + var $curlProxy; + + /** + * Set the proxy auth for cURL. + * + * @see https://curl.haxx.se/libcurl/c/CURLOPT_PROXYUSERPWD.html + * + * @var string + */ + var $curlProxyAuth; + // Private properties FROM FPDF var $DisplayPreferences; var $flowingBlockAttr; @@ -796,6 +815,8 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface var $outerblocktags; var $innerblocktags; + public $exposeVersion; + /** * @var string */ @@ -933,57 +954,57 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface private $writer; /** - * @var Mpdf\Writer\FontWriter + * @var \Mpdf\Writer\FontWriter */ private $fontWriter; /** - * @var Mpdf\Writer\MetadataWriter + * @var \Mpdf\Writer\MetadataWriter */ private $metadataWriter; /** - * @var Mpdf\Writer\ImageWriter + * @var \Mpdf\Writer\ImageWriter */ private $imageWriter; /** - * @var Mpdf\Writer\FormWriter + * @var \Mpdf\Writer\FormWriter */ private $formWriter; /** - * @var Mpdf\Writer\PageWriter + * @var \Mpdf\Writer\PageWriter */ private $pageWriter; /** - * @var Mpdf\Writer\BookmarkWriter + * @var \Mpdf\Writer\BookmarkWriter */ private $bookmarkWriter; /** - * @var Mpdf\Writer\OptionalContentWriter + * @var \Mpdf\Writer\OptionalContentWriter */ private $optionalContentWriter; /** - * @var Mpdf\Writer\ColorWriter + * @var \Mpdf\Writer\ColorWriter */ private $colorWriter; /** - * @var Mpdf\Writer\BackgroundWriter + * @var \Mpdf\Writer\BackgroundWriter */ private $backgroundWriter; /** - * @var Mpdf\Writer\JavaScriptWriter + * @var \Mpdf\Writer\JavaScriptWriter */ private $javaScriptWriter; /** - * @var Mpdf\Writer\ResourceWriter + * @var \Mpdf\Writer\ResourceWriter */ private $resourceWriter; @@ -1051,8 +1072,8 @@ public function __construct(array $config = []) $this->tableBackgrounds = []; $this->uniqstr = '20110230'; // mPDF 5.7.2 - $this->kt_y00 = ''; - $this->kt_p00 = ''; + $this->kt_y00 = 0; + $this->kt_p00 = 0; $this->BMPonly = []; $this->page = 0; $this->n = 2; @@ -1731,14 +1752,17 @@ function SetAutoPageBreak($auto, $margin = 0) function SetDisplayMode($zoom, $layout = 'continuous') { - // Set display mode in viewer - if ($zoom == 'fullpage' or $zoom == 'fullwidth' or $zoom == 'real' or $zoom == 'default' or ! is_string($zoom)) { + $allowedZoomModes = ['fullpage', 'fullwidth', 'real', 'default', 'none']; + + if (in_array($zoom, $allowedZoomModes, true) || is_numeric($zoom)) { $this->ZoomMode = $zoom; } else { throw new \Mpdf\MpdfException('Incorrect zoom display mode: ' . $zoom); } - if ($layout == 'single' or $layout == 'continuous' or $layout == 'two' or $layout == 'twoleft' or $layout == 'tworight' or $layout == 'default') { + $allowedLayoutModes = ['single', 'continuous', 'two', 'twoleft', 'tworight', 'default']; + + if (in_array($layout, $allowedLayoutModes, true)) { $this->LayoutMode = $layout; } else { throw new \Mpdf\MpdfException('Incorrect layout display mode: ' . $layout); @@ -2206,10 +2230,10 @@ function PrintBodyBackgrounds() if ($this->bodyBackgroundColor) { $s .= 'q ' . $this->SetFColor($this->bodyBackgroundColor, true) . "\n"; - if ($this->bodyBackgroundColor{0} == 5) { // RGBa - $s .= $this->SetAlpha(ord($this->bodyBackgroundColor{4}) / 100, 'Normal', true, 'F') . "\n"; - } elseif ($this->bodyBackgroundColor{0} == 6) { // CMYKa - $s .= $this->SetAlpha(ord($this->bodyBackgroundColor{5}) / 100, 'Normal', true, 'F') . "\n"; + if ($this->bodyBackgroundColor[0] == 5) { // RGBa + $s .= $this->SetAlpha(ord($this->bodyBackgroundColor[4]) / 100, 'Normal', true, 'F') . "\n"; + } elseif ($this->bodyBackgroundColor[0] == 6) { // CMYKa + $s .= $this->SetAlpha(ord($this->bodyBackgroundColor[5]) / 100, 'Normal', true, 'F') . "\n"; } $s .= sprintf('%.3F %.3F %.3F %.3F re f Q', ($clx * Mpdf::SCALE), ($cly * Mpdf::SCALE), $clw * Mpdf::SCALE, $clh * Mpdf::SCALE) . "\n"; } @@ -2295,10 +2319,10 @@ function PrintPageBackgrounds($adjustmenty = 0) $s .= 'q ' . $this->SetFColor($pb['col'], true) . "\n"; - if ($pb['col'] && $pb['col']{0} === '5') { // RGBa - $s .= $this->SetAlpha(ord($pb['col']{4}) / 100, 'Normal', true, 'F') . "\n"; - } elseif ($pb['col'] && $pb['col']{0} === '6') { // CMYKa - $s .= $this->SetAlpha(ord($pb['col']{5}) / 100, 'Normal', true, 'F') . "\n"; + if ($pb['col'] && $pb['col'][0] === '5') { // RGBa + $s .= $this->SetAlpha(ord($pb['col'][4]) / 100, 'Normal', true, 'F') . "\n"; + } elseif ($pb['col'] && $pb['col'][0] === '6') { // CMYKa + $s .= $this->SetAlpha(ord($pb['col'][5]) / 100, 'Normal', true, 'F') . "\n"; } $s .= sprintf('%.3F %.3F %.3F %.3F re f Q', $pb['x'] * Mpdf::SCALE, ($this->h - $pb['y']) * Mpdf::SCALE, $pb['w'] * Mpdf::SCALE, -$pb['h'] * Mpdf::SCALE) . "\n"; @@ -2533,10 +2557,10 @@ function PrintTableBackgrounds($adjustmenty = 0) foreach ($pbs as $pb) { if ((!isset($pb['gradient']) || !$pb['gradient']) && (!isset($pb['image_id']) || !$pb['image_id'])) { $s .= 'q ' . $this->SetFColor($pb['col'], true) . "\n"; - if ($pb['col']{0} == 5) { // RGBa - $s .= $this->SetAlpha(ord($pb['col']{4}) / 100, 'Normal', true, 'F') . "\n"; - } elseif ($pb['col']{0} == 6) { // CMYKa - $s .= $this->SetAlpha(ord($pb['col']{5}) / 100, 'Normal', true, 'F') . "\n"; + if ($pb['col'][0] == 5) { // RGBa + $s .= $this->SetAlpha(ord($pb['col'][4]) / 100, 'Normal', true, 'F') . "\n"; + } elseif ($pb['col'][0] == 6) { // CMYKa + $s .= $this->SetAlpha(ord($pb['col'][5]) / 100, 'Normal', true, 'F') . "\n"; } $s .= sprintf('%.3F %.3F %.3F %.3F re %s Q', $pb['x'] * Mpdf::SCALE, ($this->h - $pb['y']) * Mpdf::SCALE, $pb['w'] * Mpdf::SCALE, -$pb['h'] * Mpdf::SCALE, 'f') . "\n"; } @@ -3297,14 +3321,14 @@ function SetColor($col, $type = '') if (!$col) { return ''; } // mPDF 6 - if ($col{0} == 3 || $col{0} == 5) { // RGB / RGBa - $out = sprintf('%.3F %.3F %.3F rg', ord($col{1}) / 255, ord($col{2}) / 255, ord($col{3}) / 255); - } elseif ($col{0} == 1) { // GRAYSCALE - $out = sprintf('%.3F g', ord($col{1}) / 255); - } elseif ($col{0} == 2) { // SPOT COLOR - $out = sprintf('/CS%d cs %.3F scn', ord($col{1}), ord($col{2}) / 100); - } elseif ($col{0} == 4 || $col{0} == 6) { // CMYK / CMYKa - $out = sprintf('%.3F %.3F %.3F %.3F k', ord($col{1}) / 100, ord($col{2}) / 100, ord($col{3}) / 100, ord($col{4}) / 100); + if ($col[0] == 3 || $col[0] == 5) { // RGB / RGBa + $out = sprintf('%.3F %.3F %.3F rg', ord($col[1]) / 255, ord($col[2]) / 255, ord($col[3]) / 255); + } elseif ($col[0] == 1) { // GRAYSCALE + $out = sprintf('%.3F g', ord($col[1]) / 255); + } elseif ($col[0] == 2) { // SPOT COLOR + $out = sprintf('/CS%d cs %.3F scn', ord($col[1]), ord($col[2]) / 100); + } elseif ($col[0] == 4 || $col[0] == 6) { // CMYK / CMYKa + $out = sprintf('%.3F %.3F %.3F %.3F k', ord($col[1]) / 100, ord($col[2]) / 100, ord($col[3]) / 100, ord($col[4]) / 100); } if ($type == 'Draw') { $out = strtoupper($out); @@ -4558,7 +4582,7 @@ function GetJspacing($nc, $ns, $w, $inclCursive, &$cOTLdata) for ($c = 0; $c < count($cOTLdata); $c++) { for ($i = 0; $i < strlen($cOTLdata[$c]['group']); $i++) { - if ($cOTLdata[$c]['group']{$i} == 'S') { + if ($cOTLdata[$c]['group'][$i] == 'S') { // Save from last word if ($max_kashida_in_word) { $k_ctr++; @@ -5117,7 +5141,7 @@ function Cell($w, $h = 0, $txt = '', $border = 0, $ln = 0, $align = '', $fill = // Just output text; charspacing and wordspacing already set by charspacing (Tc) and ws (Tw) if ($this->usingCoreFont && !($textvar & TextVars::FC_SMALLCAPS) && !($textvar & TextVars::FC_KERNING)) { $txt2 = $this->writer->escape($txt2); - $sub .=sprintf('BT ' . $aix . ' (%s) Tj ET', $px, $py, $txt2); + $sub .= sprintf('BT ' . $aix . ' (%s) Tj ET', $px, $py, $txt2); } // IF NOT corefonts AND NO wordspacing AND NOT SIP/SMP AND NOT SmCaps AND NOT Kerning AND NOT OTL // Just output text elseif (!$this->usingCoreFont && !$this->ws && !($textvar & TextVars::FC_SMALLCAPS) && !($textvar & TextVars::FC_KERNING) && !(isset($this->CurrentFont['useOTL']) && ($this->CurrentFont['useOTL'] & 0xFF) && !empty($OTLdata['GPOSinfo']))) { @@ -5298,12 +5322,12 @@ function Cell($w, $h = 0, $txt = '', $border = 0, $ln = 0, $align = '', $fill = foreach ($this->textshadow as $ts) { $s .= ' q '; $s .= $this->SetTColor($ts['col'], true) . "\n"; - if ($ts['col']{0} == 5 && ord($ts['col']{4}) < 100) { // RGBa - $s .= $this->SetAlpha(ord($ts['col']{4}) / 100, 'Normal', true, 'F') . "\n"; - } elseif ($ts['col']{0} == 6 && ord($ts['col']{5}) < 100) { // CMYKa - $s .= $this->SetAlpha(ord($ts['col']{5}) / 100, 'Normal', true, 'F') . "\n"; - } elseif ($ts['col']{0} == 1 && $ts['col']{2} == 1 && ord($ts['col']{3}) < 100) { // Gray - $s .= $this->SetAlpha(ord($ts['col']{3}) / 100, 'Normal', true, 'F') . "\n"; + if ($ts['col'][0] == 5 && ord($ts['col'][4]) < 100) { // RGBa + $s .= $this->SetAlpha(ord($ts['col'][4]) / 100, 'Normal', true, 'F') . "\n"; + } elseif ($ts['col'][0] == 6 && ord($ts['col'][5]) < 100) { // CMYKa + $s .= $this->SetAlpha(ord($ts['col'][5]) / 100, 'Normal', true, 'F') . "\n"; + } elseif ($ts['col'][0] == 1 && $ts['col'][2] == 1 && ord($ts['col'][3]) < 100) { // Gray + $s .= $this->SetAlpha(ord($ts['col'][3]) / 100, 'Normal', true, 'F') . "\n"; } $s .= sprintf(' 1 0 0 1 %.4F %.4F cm', $ts['x'] * Mpdf::SCALE, -$ts['y'] * Mpdf::SCALE) . "\n"; $s .= $sub; @@ -5585,7 +5609,7 @@ function applyGPOSpdf($txt, $aix, $x, $y, $OTLdata, $textvar = 0) // Get YPlacement from next Base character $nextbase = $i + 1; - while ($OTLdata['group']{$nextbase} != 'C') { + while ($OTLdata['group'][$nextbase] != 'C') { $nextbase++; } if (isset($GPOSinfo[$nextbase]) && isset($GPOSinfo[$nextbase]['YPlacement']) && $GPOSinfo[$nextbase]['YPlacement']) { @@ -9406,7 +9430,7 @@ function Output($name = '', $dest = '') header('Content-disposition: inline; filename="' . $name . '"'); header('Cache-Control: public, must-revalidate, max-age=0'); header('Pragma: public'); - header('X-Generator: mPDF ' . static::VERSION); + header('X-Generator: mPDF' . ($this->exposeVersion ? (' ' . static::VERSION) : '')); header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); } @@ -9425,7 +9449,7 @@ function Output($name = '', $dest = '') header('Content-Transfer-Encoding: binary'); header('Cache-Control: public, must-revalidate, max-age=0'); header('Pragma: public'); - header('X-Generator: mPDF ' . static::VERSION); + header('X-Generator: mPDF' . ($this->exposeVersion ? (' ' . static::VERSION) : '')); header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Content-Type: application/pdf'); @@ -10915,10 +10939,15 @@ function _setLineYpos(&$fontsize, &$fontdesc, &$CSSlineheight, $blockYpos = fals // and add half to the top and half to the bottom. BUT // If an inline element has a font-size less than the block element, and the line-height is set as an em or % value // it will add too much leading below the font and expand the height of the line - so just use the block element exttop/extbottom: - if (preg_match('/mm/', $CSSlineheight) && $ypos['boxtop'] < $blockYpos['boxtop'] && $ypos['boxbottom'] > $blockYpos['boxbottom']) { + if (preg_match('/mm/', $CSSlineheight) + && ($blockYpos && $ypos['boxtop'] < $blockYpos['boxtop']) + && ($blockYpos && $ypos['boxbottom'] > $blockYpos['boxbottom'])) { + $ypos['exttop'] = $blockYpos['exttop']; $ypos['extbottom'] = $blockYpos['extbottom']; + } else { + $leading += ($lineheight - $fontheight); $ypos['exttop'] = $ypos['boxtop'] + $leading / 2; @@ -11238,7 +11267,7 @@ function SetBasePath($str = '') $host = ''; } if (!$str) { - if ($_SERVER['SCRIPT_NAME']) { + if (isset($_SERVER['SCRIPT_NAME'])) { $currentPath = dirname($_SERVER['SCRIPT_NAME']); } else { $currentPath = dirname($_SERVER['PHP_SELF']); @@ -11485,7 +11514,7 @@ function _getStyledNumber($ppgno, $type, $listmarker = false) $ppgno = $decToHebrew->convert($ppgno, $reverse); - } elseif (preg_match('/(arabic-indic|bengali|devanagari|gujarati|gurmukhi|kannada|malayalam|oriya|persian|tamil|telugu|thai|urdu|cambodian|khmer|lao)/i', $lowertype, $m)) { + } elseif (preg_match('/(arabic-indic|bengali|devanagari|gujarati|gurmukhi|kannada|malayalam|oriya|persian|tamil|telugu|thai|urdu|cambodian|khmer|lao|myanmar)/i', $lowertype, $m)) { $cp = $decToOther->getCodePage($m[1]); $ppgno = $decToOther->convert($ppgno, $cp, $checkfont); @@ -12858,7 +12887,7 @@ function Footer() $this->SetFont('arial', '', 7.5, true, true); $this->x = $this->page_box['outer_width_LR'] + 1.5; $this->y = 1; - $this->Cell($headerpgwidth, $this->FontSize, $hd, 0, 0, 'L', 0, '', 0, 0, 0, 'M'); + $this->Cell(0, $this->FontSize, $hd, 0, 0, 'L', 0, '', 0, 0, 0, 'M'); $this->SetFont($this->default_font, '', $this->original_default_font_size); } } @@ -13651,13 +13680,21 @@ function WriteHTML($html, $mode = HTMLParserMode::DEFAULT_MODE, $init = true, $c // Create Internal Links, if needed if (!empty($this->internallink)) { + foreach ($this->internallink as $k => $v) { + if (strpos($k, "#") !== false) { continue; - } // ignore + } + + if (!is_array($v)) { + continue; + } + $ypos = $v['Y']; $pagenum = $v['PAGE']; $sharp = "#"; + while (array_key_exists($sharp . $k, $this->internallink)) { $internallink = $this->internallink[$sharp . $k]; $this->SetLink($internallink, $ypos, $pagenum); @@ -14628,7 +14665,7 @@ function border_details($bd) $prop[1] = $tmp; } } else { - return []; + return ['w' => 0, 's' => 0]; } // Size $bsize = $this->sizeConverter->convert($prop[0], $refw, $this->FontSize, false); @@ -16982,23 +17019,23 @@ function PaintDivBB($divider = '', $blockstate = 0, $blvl = 0) if (isset($this->blk[$blvl]['box_shadow']) && $this->blk[$blvl]['box_shadow'] && $h > 0) { foreach ($this->blk[$blvl]['box_shadow'] as $sh) { // Colors - if ($sh['col']{0} == 1) { + if ($sh['col'][0] == 1) { $colspace = 'Gray'; - if ($sh['col']{2} == 1) { + if ($sh['col'][2] == 1) { $col1 = '1' . $sh['col'][1] . '1' . $sh['col'][3]; } else { $col1 = '1' . $sh['col'][1] . '1' . chr(100); } $col2 = '1' . $sh['col'][1] . '1' . chr(0); - } elseif ($sh['col']{0} == 4) { // CMYK + } elseif ($sh['col'][0] == 4) { // CMYK $colspace = 'CMYK'; $col1 = '6' . $sh['col'][1] . $sh['col'][2] . $sh['col'][3] . $sh['col'][4] . chr(100); $col2 = '6' . $sh['col'][1] . $sh['col'][2] . $sh['col'][3] . $sh['col'][4] . chr(0); - } elseif ($sh['col']{0} == 5) { // RGBa + } elseif ($sh['col'][0] == 5) { // RGBa $colspace = 'RGB'; $col1 = '5' . $sh['col'][1] . $sh['col'][2] . $sh['col'][3] . $sh['col'][4]; $col2 = '5' . $sh['col'][1] . $sh['col'][2] . $sh['col'][3] . chr(0); - } elseif ($sh['col']{0} == 6) { // CMYKa + } elseif ($sh['col'][0] == 6) { // CMYKa $colspace = 'CMYK'; $col1 = '6' . $sh['col'][1] . $sh['col'][2] . $sh['col'][3] . $sh['col'][4] . $sh['col'][5]; $col2 = '6' . $sh['col'][1] . $sh['col'][2] . $sh['col'][3] . $sh['col'][4] . chr(0); @@ -17028,12 +17065,12 @@ function PaintDivBB($divider = '', $blockstate = 0, $blvl = 0) // Set path for INNER shadow $shadow .= ' q 0 w '; $shadow .= $this->SetFColor($col1, true) . "\n"; - if ($col1{0} == 5 && ord($col1{4}) < 100) { // RGBa - $shadow .= $this->SetAlpha(ord($col1{4}) / 100, 'Normal', true, 'F') . "\n"; - } elseif ($col1{0} == 6 && ord($col1{5}) < 100) { // CMYKa - $shadow .= $this->SetAlpha(ord($col1{5}) / 100, 'Normal', true, 'F') . "\n"; - } elseif ($col1{0} == 1 && $col1{2} == 1 && ord($col1{3}) < 100) { // Gray - $shadow .= $this->SetAlpha(ord($col1{3}) / 100, 'Normal', true, 'F') . "\n"; + if ($col1[0] == 5 && ord($col1[4]) < 100) { // RGBa + $shadow .= $this->SetAlpha(ord($col1[4]) / 100, 'Normal', true, 'F') . "\n"; + } elseif ($col1[0] == 6 && ord($col1[5]) < 100) { // CMYKa + $shadow .= $this->SetAlpha(ord($col1[5]) / 100, 'Normal', true, 'F') . "\n"; + } elseif ($col1[0] == 1 && $col1[2] == 1 && ord($col1[3]) < 100) { // Gray + $shadow .= $this->SetAlpha(ord($col1[3]) / 100, 'Normal', true, 'F') . "\n"; } // Blur edges @@ -17907,7 +17944,8 @@ function setCSS($arrayaux, $type = '', $tag = '') // Set font size first so that e.g. MARGIN 0.83em works on font size for this element if (isset($arrayaux['FONT-SIZE'])) { $v = $arrayaux['FONT-SIZE']; - if (is_numeric($v[0]) || ($v[0] === '.')) { + $firstLetter = substr($v, 0, 1); + if (is_numeric($firstLetter) || ($firstLetter === '.')) { if ($type == 'BLOCK' && $this->blklvl > 0 && isset($this->blk[$this->blklvl - 1]['InlineProperties']) && isset($this->blk[$this->blklvl - 1]['InlineProperties']['size'])) { $mmsize = $this->sizeConverter->convert($v, $this->blk[$this->blklvl - 1]['InlineProperties']['size']); } elseif ($type == 'TABLECELL') { @@ -19510,9 +19548,9 @@ function _tableColumnWidth(&$table, $firstpass = false) if ($minwidth < 0) { // increase minimum width if (!isset($c['colspan'])) { - $wc['miw'] = max($wc['miw'], ((-$minwidth) + $extrcw)); + $wc['miw'] = max((isset($wc['miw']) ? $wc['miw'] : 0), ((-$minwidth) + $extrcw)); } else { - $c['miw'] = max($c['miw'], ((-$minwidth) + $extrcw)); + $c['miw'] = max((isset($c['miw']) ? $c['miw'] : 0), ((-$minwidth) + $extrcw)); } } if (!isset($c['colspan'])) { @@ -19563,7 +19601,7 @@ function _tableColumnWidth(&$table, $firstpass = false) for ($k = $j; $k < $lc; $k++) { $wc[$k]['miw'] = $c['miw'] / $c['colspan']; } - } elseif (!count($list)) { + } elseif (!count($list) && $wis != 0) { $wi = $c['miw'] - $wis; for ($k = $j; $k < $lc; $k++) { $wc[$k]['miw'] += ($wc[$k]['miw'] / $wis) * $wi; @@ -19584,7 +19622,7 @@ function _tableColumnWidth(&$table, $firstpass = false) for ($k = $j; $k < $lc; $k++) { $wc[$k]['maw'] = $c['maw'] / $c['colspan']; } - } elseif (!count($list)) { + } elseif (!count($list) && $was != 0) { $wi = $c['maw'] - $was; for ($k = $j; $k < $lc; $k++) { $wc[$k]['maw'] += ($wc[$k]['maw'] / $was) * $wi; @@ -20558,8 +20596,8 @@ function _tableRect($x, $y, $w, $h, $bord = -1, $details = [], $buffer = false, // Precedence to darker colours at joins $coldom = 0; if (isset($details[$side]['c']) && is_array($details[$side]['c'])) { - if ($details[$side]['c']{0} == 3) { // RGB - $coldom = 10 - (((ord($details[$side]['c']{1}) * 1.00) + (ord($details[$side]['c']{2}) * 1.00) + (ord($details[$side]['c']{3}) * 1.00)) / 76.5); + if ($details[$side]['c'][0] == 3) { // RGB + $coldom = 10 - (((ord($details[$side]['c'][1]) * 1.00) + (ord($details[$side]['c'][2]) * 1.00) + (ord($details[$side]['c'][3]) * 1.00)) / 76.5); } } // 10 black - 0 white if ($coldom) { @@ -21400,6 +21438,7 @@ function _fixTableBorders(&$table) // Set maximum cell border width meeting at LRTB edges of cell - used for extended cell border // ['border_details']['mbw']['LT'] = meeting border width - Left border - Top end if (!$table['borders_separate']) { + $cbord['border_details']['mbw']['BL'] = max($cbord['border_details']['mbw']['BL'], $cbord['border_details']['L']['w']); $cbord['border_details']['mbw']['BR'] = max($cbord['border_details']['mbw']['BR'], $cbord['border_details']['R']['w']); $cbord['border_details']['mbw']['RT'] = max($cbord['border_details']['mbw']['RT'], $cbord['border_details']['T']['w']); @@ -21408,77 +21447,163 @@ function _fixTableBorders(&$table) $cbord['border_details']['mbw']['TR'] = max($cbord['border_details']['mbw']['TR'], $cbord['border_details']['R']['w']); $cbord['border_details']['mbw']['LT'] = max($cbord['border_details']['mbw']['LT'], $cbord['border_details']['T']['w']); $cbord['border_details']['mbw']['LB'] = max($cbord['border_details']['mbw']['LB'], $cbord['border_details']['B']['w']); + if (($i + $crowsp) < $numrows && isset($cells[$i + $crowsp][$j])) { // Has Bottom adjoining cell + if ($this->packTableData) { $adjc = $cells[$i + $crowsp][$j]; $celladj = $this->_unpackCellBorder($adjc['borderbin']); } else { $celladj = & $cells[$i + $crowsp][$j]; } - $cbord['border_details']['mbw']['BL'] = max($cbord['border_details']['mbw']['BL'], $celladj['border_details']['L']['w'], $celladj['border_details']['mbw']['TL']); - $cbord['border_details']['mbw']['BR'] = max($cbord['border_details']['mbw']['BR'], $celladj['border_details']['R']['w'], $celladj['border_details']['mbw']['TR']); - $cbord['border_details']['mbw']['LB'] = max($cbord['border_details']['mbw']['LB'], $celladj['border_details']['mbw']['LT']); - $cbord['border_details']['mbw']['RB'] = max($cbord['border_details']['mbw']['RB'], $celladj['border_details']['mbw']['RT']); + + $cbord['border_details']['mbw']['BL'] = max( + $cbord['border_details']['mbw']['BL'], + $celladj ? $celladj['border_details']['L']['w'] : 0, + $celladj ? $celladj['border_details']['mbw']['TL']: 0 + ); + + $cbord['border_details']['mbw']['BR'] = max( + $cbord['border_details']['mbw']['BR'], + $celladj ? $celladj['border_details']['R']['w'] : 0, + $celladj ? $celladj['border_details']['mbw']['TR']: 0 + ); + + $cbord['border_details']['mbw']['LB'] = max( + $cbord['border_details']['mbw']['LB'], + $celladj ? $celladj['border_details']['mbw']['LT'] : 0 + ); + + $cbord['border_details']['mbw']['RB'] = max( + $cbord['border_details']['mbw']['RB'], + $celladj ? $celladj['border_details']['mbw']['RT'] : 0 + ); + unset($celladj); } + if (($j + $ccolsp) < $numcols && isset($cells[$i][$j + $ccolsp])) { // Has Right adjoining cell + if ($this->packTableData) { $adjc = $cells[$i][$j + $ccolsp]; $celladj = $this->_unpackCellBorder($adjc['borderbin']); } else { $celladj = & $cells[$i][$j + $ccolsp]; } - $cbord['border_details']['mbw']['RT'] = max($cbord['border_details']['mbw']['RT'], $celladj['border_details']['T']['w'], $celladj['border_details']['mbw']['LT']); - $cbord['border_details']['mbw']['RB'] = max($cbord['border_details']['mbw']['RB'], $celladj['border_details']['B']['w'], $celladj['border_details']['mbw']['LB']); - $cbord['border_details']['mbw']['TR'] = max($cbord['border_details']['mbw']['TR'], $celladj['border_details']['mbw']['TL']); - $cbord['border_details']['mbw']['BR'] = max($cbord['border_details']['mbw']['BR'], $celladj['border_details']['mbw']['BL']); + + $cbord['border_details']['mbw']['RT'] = max( + $cbord['border_details']['mbw']['RT'], + $celladj ? $celladj['border_details']['T']['w'] : 0, + $celladj ? $celladj['border_details']['mbw']['LT'] : 0 + ); + + $cbord['border_details']['mbw']['RB'] = max( + $cbord['border_details']['mbw']['RB'], + $celladj ? $celladj['border_details']['B']['w'] : 0, + $celladj ? $celladj['border_details']['mbw']['LB'] : 0 + ); + + $cbord['border_details']['mbw']['TR'] = max( + $cbord['border_details']['mbw']['TR'], + $celladj ? $celladj['border_details']['mbw']['TL'] : 0 + ); + + $cbord['border_details']['mbw']['BR'] = max( + $cbord['border_details']['mbw']['BR'], + $celladj ? $celladj['border_details']['mbw']['BL'] : 0 + ); + unset($celladj); } - if ($i > 0 && isset($cells[$i - 1][$j]) && (($this->packTableData && $cells[$i - 1][$j]['borderbin']) || $cells[$i - 1][$j]['border'])) { // Has Top adjoining cell + if ($i > 0 && isset($cells[$i - 1][$j]) && is_array($cells[$i - 1][$j]) && (($this->packTableData && $cells[$i - 1][$j]['borderbin']) || $cells[$i - 1][$j]['border'])) { // Has Top adjoining cell + if ($this->packTableData) { $adjc = $cells[$i - 1][$j]; $celladj = $this->_unpackCellBorder($adjc['borderbin']); } else { $celladj = & $cells[$i - 1][$j]; } - $cbord['border_details']['mbw']['TL'] = max($cbord['border_details']['mbw']['TL'], $celladj['border_details']['L']['w'], $celladj['border_details']['mbw']['BL']); - $cbord['border_details']['mbw']['TR'] = max($cbord['border_details']['mbw']['TR'], $celladj['border_details']['R']['w'], $celladj['border_details']['mbw']['BR']); - $cbord['border_details']['mbw']['LT'] = max($cbord['border_details']['mbw']['LT'], $celladj['border_details']['mbw']['LB']); - $cbord['border_details']['mbw']['RT'] = max($cbord['border_details']['mbw']['RT'], $celladj['border_details']['mbw']['RB']); + + $cbord['border_details']['mbw']['TL'] = max( + $cbord['border_details']['mbw']['TL'], + $celladj ? $celladj['border_details']['L']['w'] : 0, + $celladj ? $celladj['border_details']['mbw']['BL'] : 0 + ); + + $cbord['border_details']['mbw']['TR'] = max( + $cbord['border_details']['mbw']['TR'], + $celladj ? $celladj['border_details']['R']['w'] : 0, + $celladj ? $celladj['border_details']['mbw']['BR'] : 0 + ); + + $cbord['border_details']['mbw']['LT'] = max( + $cbord['border_details']['mbw']['LT'], + $celladj ? $celladj['border_details']['mbw']['LB'] : 0 + ); + + $cbord['border_details']['mbw']['RT'] = max( + $cbord['border_details']['mbw']['RT'], + $celladj ? $celladj['border_details']['mbw']['RB'] : 0 + ); if ($celladj['border_details']['mbw']['BL']) { $celladj['border_details']['mbw']['BL'] = max($cbord['border_details']['mbw']['TL'], $celladj['border_details']['mbw']['BL']); } + if ($celladj['border_details']['mbw']['BR']) { $celladj['border_details']['mbw']['BR'] = max($celladj['border_details']['mbw']['BR'], $cbord['border_details']['mbw']['TR']); } + if ($this->packTableData) { $cells[$i - 1][$j]['borderbin'] = $this->_packCellBorder($celladj); } unset($celladj); } - if ($j > 0 && isset($cells[$i][$j - 1]) && (($this->packTableData && $cells[$i][$j - 1]['borderbin']) || $cells[$i][$j - 1]['border'])) { // Has Left adjoining cell + + if ($j > 0 && isset($cells[$i][$j - 1]) && is_array($cells[$i][$j - 1]) && (($this->packTableData && $cells[$i][$j - 1]['borderbin']) || $cells[$i][$j - 1]['border'])) { // Has Left adjoining cell + if ($this->packTableData) { $adjc = $cells[$i][$j - 1]; $celladj = $this->_unpackCellBorder($adjc['borderbin']); } else { $celladj = & $cells[$i][$j - 1]; } - $cbord['border_details']['mbw']['LT'] = max($cbord['border_details']['mbw']['LT'], $celladj['border_details']['T']['w'], $celladj['border_details']['mbw']['RT']); - $cbord['border_details']['mbw']['LB'] = max($cbord['border_details']['mbw']['LB'], $celladj['border_details']['B']['w'], $celladj['border_details']['mbw']['RB']); - $cbord['border_details']['mbw']['BL'] = max($cbord['border_details']['mbw']['BL'], $celladj['border_details']['mbw']['BR']); - $cbord['border_details']['mbw']['TL'] = max($cbord['border_details']['mbw']['TL'], $celladj['border_details']['mbw']['TR']); + + $cbord['border_details']['mbw']['LT'] = max( + $cbord['border_details']['mbw']['LT'], + $celladj ? $celladj['border_details']['T']['w'] : 0, + $celladj ? $celladj['border_details']['mbw']['RT'] : 0 + ); + + $cbord['border_details']['mbw']['LB'] = max( + $cbord['border_details']['mbw']['LB'], + $celladj ? $celladj['border_details']['B']['w'] : 0, + $celladj ? $celladj['border_details']['mbw']['RB'] : 0 + ); + + $cbord['border_details']['mbw']['BL'] = max( + $cbord['border_details']['mbw']['BL'], + $celladj ? $celladj['border_details']['mbw']['BR'] : 0 + ); + + $cbord['border_details']['mbw']['TL'] = max( + $cbord['border_details']['mbw']['TL'], + $celladj ? $celladj['border_details']['mbw']['TR'] : 0 + ); if ($celladj['border_details']['mbw']['RT']) { $celladj['border_details']['mbw']['RT'] = max($celladj['border_details']['mbw']['RT'], $cbord['border_details']['mbw']['LT']); } + if ($celladj['border_details']['mbw']['RB']) { $celladj['border_details']['mbw']['RB'] = max($celladj['border_details']['mbw']['RB'], $cbord['border_details']['mbw']['LB']); } + if ($this->packTableData) { $cells[$i][$j - 1]['borderbin'] = $this->_packCellBorder($celladj); } + unset($celladj); } @@ -23354,9 +23479,9 @@ function MovePages($target_page, $start_page, $end_page = -1) // Update Internal Links if (count($this->internallink)) { foreach ($this->internallink as $key => $o) { - if ($o['PAGE'] >= $start_page && $o['PAGE'] <= $end_page) { + if (is_array($o) && $o['PAGE'] >= $start_page && $o['PAGE'] <= $end_page) { $this->internallink[$key]['PAGE'] += ($target_page - $start_page); - } elseif ($o['PAGE'] >= $target_page && $o['PAGE'] < $start_page) { + } elseif (is_array($o) && $o['PAGE'] >= $target_page && $o['PAGE'] < $start_page) { $this->internallink[$key]['PAGE'] += $n_toc; } } @@ -23687,6 +23812,20 @@ function IndexEntrySee($txta, $txtb) $this->Reference[] = ['t' => $txta . ' - see ' . $txtb, 'p' => []]; } + private function filesInDir($directory) + { + $files = []; + foreach ((new \DirectoryIterator($directory)) as $v) { + if ($v->isDir() || $v->isDot()) { + continue; + } + + $files[] = $v->getPathname(); + } + + return $files; + } + function InsertIndex($usedivletters = 1, $useLinking = false, $indexCollationLocale = '', $indexCollationGroup = '') { $size = count($this->Reference); @@ -23723,7 +23862,9 @@ function InsertIndex($usedivletters = 1, $useLinking = false, $indexCollationLoc } if ($usedivletters) { - if ($indexCollationGroup) { + if ($indexCollationGroup && \in_array(strtolower($indexCollationGroup), array_map(function ($v) { + return strtolower(basename($v, '.php')); + }, $this->filesInDir(__DIR__ . '/../data/collations/')))) { $collation = require __DIR__ . '/../data/collations/' . $indexCollationGroup . '.php'; } else { $collation = []; @@ -26178,7 +26319,7 @@ function WriteBarcode2($code, $x = '', $y = '', $size = 1, $height = 1, $bgcol = $rlm = $arrcode['quietR'] / $k; // Right Quiet margin $tlm = $blm = $arrcode['quietTB'] / $k; $height = 1; // Overrides - } elseif (in_array($btype, ['C128A', 'C128B', 'C128C', 'EAN128A', 'EAN128B', 'EAN128C', 'C39', 'C39+', 'C39E', 'C39E+', 'S25', 'S25+', 'I25', 'I25+', 'I25B', 'I25B+', 'C93', 'MSI', 'MSI+', 'CODABAR', 'CODE11'])) { + } elseif (in_array($btype, ['C128A', 'C128B', 'C128C', 'C128RAW', 'EAN128A', 'EAN128B', 'EAN128C', 'C39', 'C39+', 'C39E', 'C39E+', 'S25', 'S25+', 'I25', 'I25+', 'I25B', 'I25B+', 'C93', 'MSI', 'MSI+', 'CODABAR', 'CODE11'])) { $llm = $arrcode['lightmL'] * $xres; // Left Quiet margin $rlm = $arrcode['lightmR'] * $xres; // Right Quiet margin $tlm = $blm = $arrcode['lightTB'] * $xres * $height; diff --git a/vendor/mpdf/mpdf/src/Otl.php b/vendor/mpdf/mpdf/src/Otl.php index fc62b04..4603996 100644 --- a/vendor/mpdf/mpdf/src/Otl.php +++ b/vendor/mpdf/mpdf/src/Otl.php @@ -3101,7 +3101,7 @@ private function checkwordmatch(&$dict, $ptr) $ok = true; $matches = []; while ($ok) { - $x = ord($dict{$dictptr}); + $x = ord($dict[$dictptr]); $c = $this->OTLdata[$ptr]['uni'] & 0xFF; if ($x == static::_DICT_INTERMEDIATE_MATCH) { //echo "DICT_INTERMEDIATE_MATCH: ".dechex($c).'
'; @@ -3120,11 +3120,11 @@ private function checkwordmatch(&$dict, $ptr) } elseif ($x == static::_DICT_NODE_TYPE_LINEAR) { //echo "DICT_NODE_TYPE_LINEAR: ".dechex($c).'
'; $dictptr++; - $m = ord($dict{$dictptr}); + $m = ord($dict[$dictptr]); if ($c == $m) { $ptr++; if ($ptr > count($this->OTLdata) - 1) { - $next = ord($dict{$dictptr + 1}); + $next = ord($dict[$dictptr + 1]); if ($next == static::_DICT_INTERMEDIATE_MATCH || $next == static::_DICT_FINAL_MATCH) { // Do not match if next character in text is a Mark if (isset($this->OTLdata[$ptr]['uni']) && strpos($this->GlyphClassMarks, $this->OTLdata[$ptr]['hex']) === false) { @@ -3142,13 +3142,13 @@ private function checkwordmatch(&$dict, $ptr) } elseif ($x == static::_DICT_NODE_TYPE_SPLIT) { //echo "DICT_NODE_TYPE_SPLIT ON ".dechex($d).": ".dechex($c).'
'; $dictptr++; - $d = ord($dict{$dictptr}); + $d = ord($dict[$dictptr]); if ($c < $d) { $dictptr += 5; } else { $dictptr++; // Unsigned long 32-bit offset - $offset = (ord($dict{$dictptr}) * 16777216) + (ord($dict{$dictptr + 1}) << 16) + (ord($dict{$dictptr + 2}) << 8) + ord($dict{$dictptr + 3}); + $offset = (ord($dict[$dictptr]) * 16777216) + (ord($dict[$dictptr + 1]) << 16) + (ord($dict[$dictptr + 2]) << 8) + ord($dict[$dictptr + 3]); $dictptr = $offset; } } else { @@ -4680,7 +4680,7 @@ public function bidiSort($ta, $str, $dir, &$chunkOTLdata, $useGPOS) } else { $gpos = ''; } - $chardata[] = ['char' => $chunkOTLdata['char_data'][$i]['uni'], 'level' => $cel, 'type' => $chardir, 'group' => $chunkOTLdata['group']{$i}, 'GPOSinfo' => $gpos]; + $chardata[] = ['char' => $chunkOTLdata['char_data'][$i]['uni'], 'level' => $cel, 'type' => $chardir, 'group' => $chunkOTLdata['group'][$i], 'GPOSinfo' => $gpos]; } } @@ -5590,7 +5590,7 @@ public function bidiReorder(&$chunkorder, &$content, &$cOTLdata, $blockdir) if (isset($cOTLdata[$nc]['char_data'][$i]['orig_type'])) { $carac['orig_type'] = $cOTLdata[$nc]['char_data'][$i]['orig_type']; } - $carac['group'] = $cOTLdata[$nc]['group']{$i}; + $carac['group'] = $cOTLdata[$nc]['group'][$i]; $carac['chunkid'] = $chunkorder[$nc]; // gives font id and/or object ID $maxlevel = max((isset($carac['level']) ? $carac['level'] : 0), $maxlevel); @@ -5791,7 +5791,7 @@ public function replaceSpace(&$txt, &$cOTLdata) public function trimOTLdata(&$cOTLdata, $Left = true, $Right = true) { - $len = $cOTLdata['char_data'] === null ? 0 : count($cOTLdata['char_data']); + $len = (!is_array($cOTLdata) || $cOTLdata['char_data'] === null) ? 0 : count($cOTLdata['char_data']); $nLeft = 0; $nRight = 0; for ($i = 0; $i < $len; $i++) { diff --git a/vendor/mpdf/mpdf/src/OtlDump.php b/vendor/mpdf/mpdf/src/OtlDump.php index 024c54d..8943e3f 100644 --- a/vendor/mpdf/mpdf/src/OtlDump.php +++ b/vendor/mpdf/mpdf/src/OtlDump.php @@ -178,7 +178,7 @@ function getMetrics($file, $fontkey, $TTCfontID = 0, $debug = false, $BMPonly = $this->fh = fopen($file, 'rb'); if (!$this->fh) { - throw new \Mpdf\MpdfException(sprintf('Unable to open file "%s"', $file)); + throw new \Mpdf\Exception\FontException(sprintf('Unable to open file "%s"', $file)); } $this->_pos = 0; @@ -196,21 +196,21 @@ function getMetrics($file, $fontkey, $TTCfontID = 0, $debug = false, $BMPonly = $this->panose = []; if ($version == 0x4F54544F) { - throw new \Mpdf\MpdfException("Postscript outlines are not supported"); + throw new \Mpdf\Exception\FontException("Postscript outlines are not supported"); } if ($version == 0x74746366 && !$TTCfontID) { - throw new \Mpdf\MpdfException("TTCfontID for a TrueType Collection has to be defined in ttfontdata configuration key (" . $file . ")"); + throw new \Mpdf\Exception\FontException("TTCfontID for a TrueType Collection has to be defined in ttfontdata configuration key (" . $file . ")"); } if (!in_array($version, [0x00010000, 0x74727565]) && !$TTCfontID) { - throw new \Mpdf\MpdfException("Not a TrueType font: version=" . $version); + throw new \Mpdf\Exception\FontException("Not a TrueType font: version=" . $version); } if ($TTCfontID > 0) { $this->version = $version = $this->read_ulong(); // TTC Header version now if (!in_array($version, [0x00010000, 0x00020000])) { - throw new \Mpdf\MpdfException("Error parsing TrueType Collection: version=" . $version . " - " . $file); + throw new \Mpdf\Exception\FontException("Error parsing TrueType Collection: version=" . $version . " - " . $file); } $this->numTTCFonts = $this->read_ulong(); for ($i = 1; $i <= $this->numTTCFonts; $i++) { @@ -259,7 +259,7 @@ function checksumTables() } $xchecksum = $t['checksum']; if ($xchecksum != $checksum) { - throw new \Mpdf\MpdfException(sprintf('TTF file "%s": invalid checksum %s table: %s (expected %s)', $this->filename, dechex($checksum[0]) . dechex($checksum[1]), $t['tag'], dechex($xchecksum[0]) . dechex($xchecksum[1]))); + throw new \Mpdf\Exception\FontException(sprintf('TTF file "%s": invalid checksum %s table: %s (expected %s)', $this->filename, dechex($checksum[0]) . dechex($checksum[1]), $t['tag'], dechex($xchecksum[0]) . dechex($xchecksum[1]))); } } } @@ -473,7 +473,7 @@ function extractInfo($debug = false, $BMPonly = false, $kerninfo = false, $useOT $name_offset = $this->seek_table("name"); $format = $this->read_ushort(); if ($format != 0 && $format != 1) { - throw new \Mpdf\MpdfException("Unknown name table format " . $format); + throw new \Mpdf\Exception\FontException("Error loading font: Unknown name table format " . $format); } $numRecords = $this->read_ushort(); $string_data_offset = $name_offset + $this->read_ushort(); @@ -495,7 +495,7 @@ function extractInfo($debug = false, $BMPonly = false, $kerninfo = false, $useOT $opos = $this->_pos; $this->seek($string_data_offset + $offset); if ($length % 2 != 0) { - throw new \Mpdf\MpdfException("PostScript name is UTF-16BE string of odd length"); + throw new \Mpdf\Exception\FontException("Error loading font: PostScript name is UTF-16BE string of odd length"); } $length /= 2; $N = ''; @@ -536,14 +536,14 @@ function extractInfo($debug = false, $BMPonly = false, $kerninfo = false, $useOT } } if (!$psName) { - throw new \Mpdf\MpdfException("Could not find PostScript font name: " . $this->filename); + throw new \Mpdf\Exception\FontException("Error loading font: Could not find PostScript font name: " . $this->filename); } if ($debug) { for ($i = 0; $i < count($psName); $i++) { $c = $psName[$i]; $oc = ord($c); if ($oc > 126 || strpos(' [](){}<>/%', $c) !== false) { - throw new \Mpdf\MpdfException("psName=" . $psName . " contains invalid character " . $c . " ie U+" . ord(c)); + throw new \Mpdf\Exception\FontException("psName=" . $psName . " contains invalid character " . $c . " ie U+" . ord(c)); } } } @@ -581,14 +581,14 @@ function extractInfo($debug = false, $BMPonly = false, $kerninfo = false, $useOT $ver_maj = $this->read_ushort(); $ver_min = $this->read_ushort(); if ($ver_maj != 1) { - throw new \Mpdf\MpdfException('Unknown head table version ' . $ver_maj . '.' . $ver_min); + throw new \Mpdf\Exception\FontException('Error loading font: Unknown head table version ' . $ver_maj . '.' . $ver_min); } $this->fontRevision = $this->read_ushort() . $this->read_ushort(); $this->skip(4); $magic = $this->read_ulong(); if ($magic != 0x5F0F3CF5) { - throw new \Mpdf\MpdfException('Invalid head table magic ' . $magic); + throw new \Mpdf\Exception\FontException('Error loading font: Invalid head table magic ' . $magic); } $this->skip(2); } else { @@ -606,7 +606,7 @@ function extractInfo($debug = false, $BMPonly = false, $kerninfo = false, $useOT $indexToLocFormat = $this->read_ushort(); $glyphDataFormat = $this->read_ushort(); if ($glyphDataFormat != 0) { - throw new \Mpdf\MpdfException('Unknown glyph data format ' . $glyphDataFormat); + throw new \Mpdf\Exception\FontException('Error loading font: Unknown glyph data format ' . $glyphDataFormat); } /////////////////////////////////// @@ -635,7 +635,7 @@ function extractInfo($debug = false, $BMPonly = false, $kerninfo = false, $useOT if ($fsType == 0x0002 || ($fsType & 0x0300) != 0) { global $overrideTTFFontRestriction; if (!$overrideTTFFontRestriction) { - throw new \Mpdf\MpdfException('ERROR - Font file ' . $this->filename . ' cannot be embedded due to copyright restrictions.'); + throw new \Mpdf\Exception\FontException('Font file ' . $this->filename . ' cannot be embedded due to copyright restrictions.'); } $this->restrictedUse = true; } @@ -685,7 +685,7 @@ function extractInfo($debug = false, $BMPonly = false, $kerninfo = false, $useOT $ver_maj = $this->read_ushort(); $ver_min = $this->read_ushort(); if ($ver_maj < 1 || $ver_maj > 4) { - throw new \Mpdf\MpdfException('Unknown post table version ' . $ver_maj); + throw new \Mpdf\Exception\FontException('Error loading font: Unknown post table version ' . $ver_maj); } } else { $this->skip(4); @@ -715,7 +715,7 @@ function extractInfo($debug = false, $BMPonly = false, $kerninfo = false, $useOT $ver_maj = $this->read_ushort(); $ver_min = $this->read_ushort(); if ($ver_maj != 1) { - throw new \Mpdf\MpdfException('Unknown hhea table version ' . $ver_maj); + throw new \Mpdf\Exception\FontException(sprintf('Error loading font: Unknown hhea table version %s', $ver_maj)); } $this->skip(28); } else { @@ -723,11 +723,11 @@ function extractInfo($debug = false, $BMPonly = false, $kerninfo = false, $useOT } $metricDataFormat = $this->read_ushort(); if ($metricDataFormat != 0) { - throw new \Mpdf\MpdfException('Unknown horizontal metric data format ' . $metricDataFormat); + throw new \Mpdf\Exception\FontException('Error loading font: Unknown horizontal metric data format ' . $metricDataFormat); } $numberOfHMetrics = $this->read_ushort(); if ($numberOfHMetrics == 0) { - throw new \Mpdf\MpdfException('Number of horizontal metrics is 0'); + throw new \Mpdf\Exception\FontException('Error loading font: Number of horizontal metrics is 0'); } /////////////////////////////////// @@ -738,7 +738,7 @@ function extractInfo($debug = false, $BMPonly = false, $kerninfo = false, $useOT $ver_maj = $this->read_ushort(); $ver_min = $this->read_ushort(); if ($ver_maj != 1) { - throw new \Mpdf\MpdfException('Unknown maxp table version ' . $ver_maj); + throw new \Mpdf\Exception\FontException('Error loading font: Unknown maxp table version ' . $ver_maj); } } else { $this->skip(4); @@ -781,7 +781,7 @@ function extractInfo($debug = false, $BMPonly = false, $kerninfo = false, $useOT } if (!$unicode_cmap_offset) { - throw new \Mpdf\MpdfException('Font (' . $this->filename . ') does not have cmap for Unicode (platform 3, encoding 1, format 4, or platform 0, any encoding, format 4)'); + throw new \Mpdf\Exception\FontException('Font (' . $this->filename . ') does not have cmap for Unicode (platform 3, encoding 1, format 4, or platform 0, any encoding, format 4)'); } $sipset = false; @@ -858,7 +858,7 @@ function extractInfo($debug = false, $BMPonly = false, $kerninfo = false, $useOT $bctr++; } } else { - throw new \Mpdf\MpdfException($names[1] . " : WARNING - The font does not have enough space to map all (unmapped) included glyphs into Private Use Area U+E000 - U+F8FF"); + throw new \Mpdf\Exception\FontException(sprintf('Font "%s" does not have cmap for Unicode (platform 3, encoding 1, format 4, or platform 0, any encoding, format 4)', $this->filename)); } } $glyphToChar[$gid][] = $bctr; @@ -1568,7 +1568,7 @@ function _getGSUBtables() } } } else { - throw new \Mpdf\MpdfException("GPOS Lookup Type " . $Lookup[$i]['Type'] . ", Format " . $SubstFormat . " not supported (ttfontsuni.php)."); + throw new \Mpdf\Exception\FontException("GPOS Lookup Type " . $Lookup[$i]['Type'] . ", Format " . $SubstFormat . " not supported (ttfontsuni.php)."); } } } // LookupType 6: Chaining Contextual Substitution Subtable @@ -1625,7 +1625,7 @@ function _getGSUBtables() } } } else { - throw new \Mpdf\MpdfException("Lookup Type " . $Lookup[$i]['Type'] . " not supported."); + throw new \Mpdf\Exception\FontException("Lookup Type " . $Lookup[$i]['Type'] . " not supported."); } } } @@ -1807,7 +1807,7 @@ function _getGSUBtables() $glyphs = $this->_getCoverage(); $Lookup[$i]['Subtable'][$c]['CoverageInputGlyphs'][] = implode("|", $glyphs); } - throw new \Mpdf\MpdfException("Lookup Type 5, SubstFormat 3 not tested. Please report this with the name of font used - " . $this->fontkey); + throw new \Mpdf\Exception\FontException("Lookup Type 5, SubstFormat 3 not tested. Please report this with the name of font used - " . $this->fontkey); } } } @@ -2728,7 +2728,7 @@ function _getGSUBignoreString($flag, $MarkFilteringSet) // Flag & 0x0010 = UseMarkFilteringSet if ($flag & 0x0010) { - throw new \Mpdf\MpdfException("This font " . $this->fontkey . " contains MarkGlyphSets"); + throw new \Mpdf\Exception\FontException("This font " . $this->fontkey . " contains MarkGlyphSets"); $str = "Mark Glyph Set: "; $str .= $this->MarkGlyphSets[$MarkFilteringSet]; } @@ -3757,21 +3757,21 @@ function _getGPOSarray(&$Lookup, $lul, $scripttag, $level = 1, $lcoverage = '', // Format 1: //=========== if ($PosFormat == 1) { - throw new \Mpdf\MpdfException("GPOS Lookup Type " . $Type . " Format " . $PosFormat . " not YET TESTED."); + throw new \Mpdf\Exception\FontException("GPOS Lookup Type " . $Type . " Format " . $PosFormat . " not YET TESTED."); } //=========== // Format 2: //=========== else { if ($PosFormat == 2) { - throw new \Mpdf\MpdfException("GPOS Lookup Type " . $Type . " Format " . $PosFormat . " not YET TESTED."); + throw new \Mpdf\Exception\FontException("GPOS Lookup Type " . $Type . " Format " . $PosFormat . " not YET TESTED."); } //=========== // Format 3: //=========== else { if ($PosFormat == 3) { - throw new \Mpdf\MpdfException("GPOS Lookup Type " . $Type . " Format " . $PosFormat . " not YET TESTED."); + throw new \Mpdf\Exception\FontException("GPOS Lookup Type " . $Type . " Format " . $PosFormat . " not YET TESTED."); } else { - throw new \Mpdf\MpdfException("GPOS Lookup Type " . $Type . ", Format " . $PosFormat . " not supported."); + throw new \Mpdf\Exception\FontException("GPOS Lookup Type " . $Type . ", Format " . $PosFormat . " not supported."); } } } @@ -3785,7 +3785,7 @@ function _getGPOSarray(&$Lookup, $lul, $scripttag, $level = 1, $lcoverage = '', // Format 1: //=========== if ($PosFormat == 1) { - throw new \Mpdf\MpdfException("GPOS Lookup Type " . $Type . " Format " . $PosFormat . " not TESTED YET."); + throw new \Mpdf\Exception\FontException("GPOS Lookup Type " . $Type . " Format " . $PosFormat . " not TESTED YET."); } //=========== // Format 2: //=========== @@ -3794,7 +3794,7 @@ function _getGPOSarray(&$Lookup, $lul, $scripttag, $level = 1, $lcoverage = '', $html .= '
GPOS Lookup Type 8: Format 2 not yet supported in OTL dump
'; continue; /* NB When developing - cf. GSUB 6.2 */ - throw new \Mpdf\MpdfException("GPOS Lookup Type " . $Type . " Format " . $PosFormat . " not TESTED YET."); + throw new \Mpdf\Exception\FontException("GPOS Lookup Type " . $Type . " Format " . $PosFormat . " not TESTED YET."); } //=========== // Format 3: //=========== @@ -4179,7 +4179,7 @@ function getLOCA($indexToLocFormat, $numGlyphs) $this->glyphPos[] = ($arr[$n + 1]); } } else { - throw new \Mpdf\MpdfException('Unknown location table format ' . $indexToLocFormat); + throw new \Mpdf\Exception\FontException('Unknown location table format ' . $indexToLocFormat); } } } diff --git a/vendor/mpdf/mpdf/src/Pdf/Protection.php b/vendor/mpdf/mpdf/src/Pdf/Protection.php index bc0c155..8a63da9 100644 --- a/vendor/mpdf/mpdf/src/Pdf/Protection.php +++ b/vendor/mpdf/mpdf/src/Pdf/Protection.php @@ -270,7 +270,7 @@ private function oValue($user_pass, $owner_pass) for ($i = 1; $i <= 19; ++$i) { $key = ''; for ($j = 0; $j < $len; ++$j) { - $key .= chr(ord($owner_rc4_key{$j}) ^ $i); + $key .= chr(ord($owner_rc4_key[$j]) ^ $i); } $enc = $this->rc4($key, $enc); } @@ -288,7 +288,7 @@ private function uValue() for ($i = 1; $i <= 19; ++$i) { $key = ''; for ($j = 0; $j < $len; ++$j) { - $key .= chr(ord($this->encryptionKey{$j}) ^ $i); + $key .= chr(ord($this->encryptionKey[$j]) ^ $i); } $enc = $this->rc4($key, $enc); } @@ -352,7 +352,7 @@ private function hexToString($hs) ++$len; } for ($i = 0; $i < $len; $i += 2) { - $s .= chr(hexdec($hs{$i} . $hs{($i + 1)})); + $s .= chr(hexdec($hs[$i] . $hs[($i + 1)])); } return $s; diff --git a/vendor/mpdf/mpdf/src/RemoteContentFetcher.php b/vendor/mpdf/mpdf/src/RemoteContentFetcher.php index dd266c8..f1547ec 100644 --- a/vendor/mpdf/mpdf/src/RemoteContentFetcher.php +++ b/vendor/mpdf/mpdf/src/RemoteContentFetcher.php @@ -50,10 +50,32 @@ public function getFileContentsByCurl($url) curl_setopt($ch, CURLOPT_CAINFO, $this->mpdf->curlCaCertificate); } + if ($this->mpdf->curlProxy) { + curl_setopt($ch, CURLOPT_PROXY, $this->mpdf->curlProxy); + if ($this->mpdf->curlProxyAuth) { + curl_setopt($ch, CURLOPT_PROXYUSERPWD, $this->mpdf->curlProxyAuth); + } + } + $data = curl_exec($ch); if (curl_error($ch)) { - $this->logger->error(sprintf('cURL error: "%s"', curl_error($ch)), ['context' => LogContext::REMOTE_CONTENT]); + $message = sprintf('cURL error: "%s"', curl_error($ch)); + $this->logger->error($message, ['context' => LogContext::REMOTE_CONTENT]); + + if ($this->mpdf->debug) { + throw new \Mpdf\MpdfException($message); + } + } + + $info = curl_getinfo($ch); + if (isset($info['http_code']) && $info['http_code'] !== 200) { + $message = sprintf('HTTP error: %d', $info['http_code']); + $this->logger->error($message, ['context' => LogContext::REMOTE_CONTENT]); + + if ($this->mpdf->debug) { + throw new \Mpdf\MpdfException($message); + } } curl_close($ch); diff --git a/vendor/mpdf/mpdf/src/Shaper/Indic.php b/vendor/mpdf/mpdf/src/Shaper/Indic.php index 45a040c..28e3001 100644 --- a/vendor/mpdf/mpdf/src/Shaper/Indic.php +++ b/vendor/mpdf/mpdf/src/Shaper/Indic.php @@ -149,11 +149,11 @@ public static function set_indic_properties(&$info, $scriptblock) if ($u == 0x200C) { $cat = self::OT_ZWNJ; - } else if ($u == 0x200D) { + } elseif ($u == 0x200D) { $cat = self::OT_ZWJ; - } else if ($u == 0x25CC) { + } elseif ($u == 0x25CC) { $cat = self::OT_DOTTEDCIRCLE; - } else if ($u == 0x0A71) { + } elseif ($u == 0x0A71) { $cat = self::OT_SM; } /* GURMUKHI ADDAK. More like consonant medial. like 0A75. */ @@ -184,9 +184,9 @@ public static function set_indic_properties(&$info, $scriptblock) if (self::is_ra($u)) { $cat = self::OT_RA; } - } else if ($cat == self::OT_M) { + } elseif ($cat == self::OT_M) { $pos = self::matra_position($u, $pos); - } else if ($cat == self::OT_SM || $cat == self::OT_VD) { + } elseif ($cat == self::OT_SM || $cat == self::OT_VD) { $pos = self::POS_SMVD; } @@ -224,7 +224,7 @@ public static function set_syllables(&$o, $s, &$broken_syllables) $syllable_type = self::CONSONANT_SYLLABLE; } // VOWEL_SYLLABLE Vowel-based syllable // From OT spec: - else if (preg_match('/^(RH|r)?V[N]?([ZJ]?H[CR]m*|J[CR]m*)?([M]*[N]?[H]?)?[S]?[v]{0,2}/', substr($s, $ptr), $ma)) { + elseif (preg_match('/^(RH|r)?V[N]?([ZJ]?H[CR]m*|J[CR]m*)?([M]*[N]?[H]?)?[S]?[v]{0,2}/', substr($s, $ptr), $ma)) { // From HarfBuzz: //else if (preg_match('/^(RH|r)?V(Z?[N]{0,2})?(J|([ZJ]?H(J[N]?)?[CR]J?(Z?[N]{0,2})?){0,4}((([ZJ]?H(J[N]?)?)|HZ)|(HJ)?([ZJ]{0,3}M[N]?(H|JHJR)?){0,4})?(S[Z]?)?[v]{0,2})/', substr($s,$ptr), $ma)) { $syllable_length = strlen($ma[0]); @@ -232,7 +232,7 @@ public static function set_syllables(&$o, $s, &$broken_syllables) } /* Apply only if it's a word start. */ // STANDALONE_CLUSTER Stand Alone syllable at start of word // From OT spec: - else if (($ptr == 0 || + elseif (($ptr == 0 || $o[$ptr - 1]['general_category'] < Ucdn::UNICODE_GENERAL_CATEGORY_LOWERCASE_LETTER || $o[$ptr - 1]['general_category'] > Ucdn::UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK ) && (preg_match('/^(RH|r)?[sD][N]?([ZJ]?H[CR]m*)?([M]*[N]?[H]?)?[S]?[v]{0,2}/', substr($s, $ptr), $ma))) { @@ -241,7 +241,7 @@ public static function set_syllables(&$o, $s, &$broken_syllables) $syllable_length = strlen($ma[0]); $syllable_type = self::STANDALONE_CLUSTER; } // BROKEN_CLUSTER syllable - else if (preg_match('/^(RH|r)?[N]?([ZJ]?H[CR])?([M]*[N]?[H]?)?[S]?[v]{0,2}/', substr($s, $ptr), $ma)) { + elseif (preg_match('/^(RH|r)?[N]?([ZJ]?H[CR])?([M]*[N]?[H]?)?[S]?[v]{0,2}/', substr($s, $ptr), $ma)) { // From HarfBuzz: //else if (preg_match('/^(RH|r)?(Z?[N]{0,2})?(([ZJ]?H(J[N]?)?)[CR]J?(Z?[N]{0,2})?){0,4}((([ZJ]?H(J[N]?)?)|HZ)|(HJ)?([ZJ]{0,3}M[N]?(H|JHJR)?){0,4})(S[Z]?)?[v]{0,2}/', substr($s,$ptr), $ma)) { if (strlen($ma[0])) { // May match blank @@ -279,7 +279,7 @@ public static function set_syllables_sinhala(&$o, $s, &$broken_syllables) $syllable_type = self::CONSONANT_SYLLABLE; } // VOWEL_SYLLABLE Vowel-based syllable // From OT spec: - else if (preg_match('/^V[S]{0,1}/', substr($s, $ptr), $ma)) { + elseif (preg_match('/^V[S]{0,1}/', substr($s, $ptr), $ma)) { $syllable_length = strlen($ma[0]); $syllable_type = self::VOWEL_SYLLABLE; } @@ -310,11 +310,11 @@ public static function set_syllables_khmer(&$o, $s, &$broken_syllables) $syllable_length = strlen($ma[0]); $syllable_type = self::CONSONANT_SYLLABLE; } // VOWEL_SYLLABLE Vowel-based syllable - else if (preg_match('/^(RH|r)?V((Z?F)?[N]{0,2})?(J|([ZJ]?G(JN?)?[CR]J?((Z?F)?[N]{0,2})?){0,4}((([ZJ]?G(JN?)?)|GZ)|(GJ)?([ZJ]{0,3}MN?(H|JHJR)?){0,4})?(G([CR]J?((Z?F)?[N]{0,2})?|V))?(SZ?)?[v]{0,2})/', substr($s, $ptr), $ma)) { + elseif (preg_match('/^(RH|r)?V((Z?F)?[N]{0,2})?(J|([ZJ]?G(JN?)?[CR]J?((Z?F)?[N]{0,2})?){0,4}((([ZJ]?G(JN?)?)|GZ)|(GJ)?([ZJ]{0,3}MN?(H|JHJR)?){0,4})?(G([CR]J?((Z?F)?[N]{0,2})?|V))?(SZ?)?[v]{0,2})/', substr($s, $ptr), $ma)) { $syllable_length = strlen($ma[0]); $syllable_type = self::VOWEL_SYLLABLE; } // BROKEN_CLUSTER syllable - else if (preg_match('/^(RH|r)?((Z?F)?[N]{0,2})?(([ZJ]?G(JN?)?)[CR]J?((Z?F)?[N]{0,2})?){0,4}((([ZJ]?G(JN?)?)|GZ)|(GJ)?([ZJ]{0,3}MN?(H|JHJR)?){0,4})(G([CR]J?((Z?F)?[N]{0,2})?|V))?(SZ?)?[v]{0,2}/', substr($s, $ptr), $ma)) { + elseif (preg_match('/^(RH|r)?((Z?F)?[N]{0,2})?(([ZJ]?G(JN?)?)[CR]J?((Z?F)?[N]{0,2})?){0,4}((([ZJ]?G(JN?)?)|GZ)|(GJ)?([ZJ]{0,3}MN?(H|JHJR)?){0,4})(G([CR]J?((Z?F)?[N]{0,2})?|V))?(SZ?)?[v]{0,2}/', substr($s, $ptr), $ma)) { if (strlen($ma[0])) { // May match blank $syllable_length = strlen($ma[0]); $syllable_type = self::BROKEN_CLUSTER; @@ -367,9 +367,9 @@ public static function update_consonant_positions(&$info, $GSUBdata) // If would substitute... if (isset($GSUBdata['pref'][$c])) { $info[$i]['indic_position'] = self::POS_POST_C; - } else if (isset($GSUBdata['blwf'][$c])) { + } elseif (isset($GSUBdata['blwf'][$c])) { $info[$i]['indic_position'] = self::POS_BELOW_C; - } else if (isset($GSUBdata['pstf'][$c])) { + } elseif (isset($GSUBdata['pstf'][$c])) { $info[$i]['indic_position'] = self::POS_POST_C; } } @@ -473,7 +473,7 @@ public static function initial_reordering_syllable(&$info, $GSUBdata, $indic_con $base = $start; $has_reph = true; } - } else if ($indic_config[4] == self::REPH_MODE_LOG_REPHA && $info[$start]['indic_category'] == self::OT_REPHA) { + } elseif ($indic_config[4] == self::REPH_MODE_LOG_REPHA && $info[$start]['indic_category'] == self::OT_REPHA) { $limit += 1; while ($limit < $end && self::is_joiner($info[$limit])) { $limit++; @@ -681,7 +681,7 @@ public static function initial_reordering_syllable(&$info, $GSUBdata, $indic_con } } } - } else if ($info[$i]['indic_position'] != self::POS_SMVD) { + } elseif ($info[$i]['indic_position'] != self::POS_SMVD) { $last_pos = $info[$i]['indic_position']; } } @@ -691,7 +691,7 @@ public static function initial_reordering_syllable(&$info, $GSUBdata, $indic_con for ($i = $base + 1; $i < $end; $i++) { if (self::is_halant_or_coeng($info[$i])) { $last_halant = $i; - } else if (self::is_consonant($info[$i])) { + } elseif (self::is_consonant($info[$i])) { for ($j = $last_halant; $j < $i; $j++) { if ($info[$j]['indic_position'] != self::POS_SMVD) { $info[$j]['indic_position'] = $info[$i]['indic_position']; @@ -805,7 +805,7 @@ public static function initial_reordering_syllable(&$info, $GSUBdata, $indic_con if (isset($GSUBdata['blwf'][$info[$i + 2]['uni']])) { $info[$i + 1]['mask'] |= self::FLAG(self::BLWF); $info[$i + 2]['mask'] |= self::FLAG(self::BLWF); - } /* If would not substitute as blwf, mark Ra+Halant for RPHF using following Halant (if present) */ else if (self::is_halant_or_coeng($info[$i + 3])) { + } /* If would not substitute as blwf, mark Ra+Halant for RPHF using following Halant (if present) */ elseif (self::is_halant_or_coeng($info[$i + 3])) { $info[$i + 2]['mask'] |= self::FLAG(self::RPHF); $info[$i + 3]['mask'] |= self::FLAG(self::RPHF); } diff --git a/vendor/mpdf/mpdf/src/Shaper/Myanmar.php b/vendor/mpdf/mpdf/src/Shaper/Myanmar.php index 7bcad01..9a68eda 100644 --- a/vendor/mpdf/mpdf/src/Shaper/Myanmar.php +++ b/vendor/mpdf/mpdf/src/Shaper/Myanmar.php @@ -122,9 +122,9 @@ public static function set_myanmar_properties(&$info) */ if (self::in_range($u, 0xFE00, 0xFE0F)) { $cat = self::OT_VS; - } else if ($u == 0x200C) { + } elseif ($u == 0x200C) { $cat = self::OT_ZWNJ; - } else if ($u == 0x200D) { + } elseif ($u == 0x200D) { $cat = self::OT_ZWJ; } @@ -275,7 +275,7 @@ public static function set_syllables(&$o, $s, &$broken_syllables) $syllable_length = strlen($ma[0]); $syllable_type = self::CONSONANT_SYLLABLE; } // BROKEN_CLUSTER syllable - else if (preg_match('/^(RaH)?s?(H|[a]*[n]?[l]?((m[k]?|k)[a]?)?[e]*[v]*[b]*[A]*(N[a]?)?(t[k]?[a]*[v]*[A]*(N[a]?)?)*(p[A]*(N[a]?)?)*S*[J|Z]?)/', substr($s, $ptr), $ma)) { + elseif (preg_match('/^(RaH)?s?(H|[a]*[n]?[l]?((m[k]?|k)[a]?)?[e]*[v]*[b]*[A]*(N[a]?)?(t[k]?[a]*[v]*[A]*(N[a]?)?)*(p[A]*(N[a]?)?)*S*[J|Z]?)/', substr($s, $ptr), $ma)) { if (strlen($ma[0])) { // May match blank $syllable_length = strlen($ma[0]); $syllable_type = self::BROKEN_CLUSTER; diff --git a/vendor/mpdf/mpdf/src/Shaper/Sea.php b/vendor/mpdf/mpdf/src/Shaper/Sea.php index 8bc7a6b..40adacc 100644 --- a/vendor/mpdf/mpdf/src/Shaper/Sea.php +++ b/vendor/mpdf/mpdf/src/Shaper/Sea.php @@ -183,7 +183,7 @@ public static function set_syllables(&$o, $s, &$broken_syllables) $syllable_length = strlen($ma[0]); $syllable_type = self::CONSONANT_SYLLABLE; } // BROKEN_CLUSTER syllable - else if (preg_match('/^(p|a|b|t|HC|M|R|T|A)+/', substr($s, $ptr), $ma)) { + elseif (preg_match('/^(p|a|b|t|HC|M|R|T|A)+/', substr($s, $ptr), $ma)) { $syllable_length = strlen($ma[0]); $syllable_type = self::BROKEN_CLUSTER; $broken_syllables = true; diff --git a/vendor/mpdf/mpdf/src/TTFontFile.php b/vendor/mpdf/mpdf/src/TTFontFile.php index 0834ff0..fb5ad1e 100644 --- a/vendor/mpdf/mpdf/src/TTFontFile.php +++ b/vendor/mpdf/mpdf/src/TTFontFile.php @@ -228,7 +228,7 @@ public function getMetrics($file, $fontkey, $TTCfontID = 0, $debug = false, $BMP $this->fh = fopen($file, 'rb'); if (!$this->fh) { - throw new \Mpdf\MpdfException(sprintf('Unable to open font file "%s"', $file)); + throw new \Mpdf\Exception\FontException(sprintf('Unable to open font file "%s"', $file)); } $this->_pos = 0; @@ -265,21 +265,21 @@ public function getMetrics($file, $fontkey, $TTCfontID = 0, $debug = false, $BMP $this->panose = []; if ($version === 0x4F54544F) { - throw new \Mpdf\MpdfException('Postscript outlines are not supported'); + throw new \Mpdf\Exception\FontException('Postscript outlines are not supported'); } if ($version === 0x74746366 && !$TTCfontID) { - throw new \Mpdf\MpdfException(sprintf('TTCfontID for a TrueType Collection is not defined in mPDF "fontdata" configuration (%s)', $file)); + throw new \Mpdf\Exception\FontException(sprintf('TTCfontID for a TrueType Collection is not defined in mPDF "fontdata" configuration (%s)', $file)); } if (!in_array($version, [0x00010000, 0x74727565], true) && !$TTCfontID) { - throw new \Mpdf\MpdfException(sprintf('Not a TrueType font: version=%s)', $version)); + throw new \Mpdf\Exception\FontException(sprintf('Not a TrueType font: version=%s)', $version)); } if ($TTCfontID > 0) { $this->version = $version = $this->read_ulong(); // TTC Header version now if (!in_array($version, [0x00010000, 0x00020000], true)) { - throw new \Mpdf\MpdfException(sprintf('Error parsing TrueType Collection: version=%s - (%s)', $version, $file)); + throw new \Mpdf\Exception\FontException(sprintf('Error parsing TrueType Collection: version=%s - (%s)', $version, $file)); } $this->numTTCFonts = $this->read_ulong(); for ($i = 1; $i <= $this->numTTCFonts; $i++) { @@ -332,7 +332,7 @@ function checksumTables() } $xchecksum = $t['checksum']; if ($xchecksum != $checksum) { - throw new \Mpdf\MpdfException(sprintf('TTF file "%s": invalid checksum %s table: %s (expected %s)', $this->filename, dechex($checksum[0]) . dechex($checksum[1]), $t['tag'], dechex($xchecksum[0]) . dechex($xchecksum[1]))); + throw new \Mpdf\Exception\FontException(sprintf('TTF file "%s": invalid checksum %s table: %s (expected %s)', $this->filename, dechex($checksum[0]) . dechex($checksum[1]), $t['tag'], dechex($xchecksum[0]) . dechex($xchecksum[1]))); } } } @@ -548,7 +548,7 @@ function getCTG($file, $TTCfontID = 0, $debug = false, $useOTL = false) $this->fh = fopen($file, 'rb'); if (!$this->fh) { - throw new \Mpdf\MpdfException(sprintf('Unable to open file "%s"', $file)); + throw new \Mpdf\Exception\FontException(sprintf('Unable to open file "%s"', $file)); } $this->_pos = 0; @@ -563,7 +563,7 @@ function getCTG($file, $TTCfontID = 0, $debug = false, $useOTL = false) if ($TTCfontID > 0) { $this->version = $version = $this->read_ulong(); // TTC Header version now if (!in_array($version, [0x00010000, 0x00020000], true)) { - throw new \Mpdf\MpdfException(sprintf("Error parsing TrueType Collection: version=%s (%s)", $version, $file)); + throw new \Mpdf\Exception\FontException(sprintf("Error parsing TrueType Collection: version=%s (%s)", $version, $file)); } $this->numTTCFonts = $this->read_ulong(); for ($i = 1; $i <= $this->numTTCFonts; $i++) { @@ -616,7 +616,7 @@ function getCTG($file, $TTCfontID = 0, $debug = false, $useOTL = false) $bctr++; } // Avoid overwriting a glyph already mapped in PUA if ($bctr > 0xF8FF) { - throw new \Mpdf\MpdfException(sprintf('Font "%s" cannot map all included glyphs into Private Use Area U+E000-U+F8FF; cannot use useOTL on this font', $file)); + throw new \Mpdf\Exception\FontException(sprintf('Font "%s" cannot map all included glyphs into Private Use Area U+E000-U+F8FF; cannot use useOTL on this font', $file)); } $glyphToChar[$gid][] = $bctr; $charToGlyph[$bctr] = $gid; @@ -636,7 +636,7 @@ function getTTCFonts($file) $this->fh = fopen($file, 'rb'); if (!$this->fh) { - throw new \Mpdf\MpdfException(sprintf('Unable to open file "%s"', $file)); + throw new \Mpdf\Exception\FontException(sprintf('Unable to open file "%s"', $file)); } $this->numTTCFonts = 0; @@ -645,10 +645,10 @@ function getTTCFonts($file) if ($version === 0x74746366) { $this->version = $version = $this->read_ulong(); // TTC Header version now if (!in_array($version, [0x00010000, 0x00020000], true)) { - throw new \Mpdf\MpdfException(sprintf("Error parsing TrueType Collection: version=%s (%s)", $version, $file)); + throw new \Mpdf\Exception\FontException(sprintf("Error parsing TrueType Collection: version=%s (%s)", $version, $file)); } } else { - throw new \Mpdf\MpdfException(sprintf("Not a TrueType Collection: version=%s (%s)", $version, $file)); + throw new \Mpdf\Exception\FontException(sprintf("Not a TrueType Collection: version=%s (%s)", $version, $file)); } $this->numTTCFonts = $this->read_ulong(); @@ -664,7 +664,7 @@ function extractInfo($debug = false, $BMPonly = false, $useOTL = 0) $name_offset = $this->seek_table("name"); $format = $this->read_ushort(); if ($format != 0 && $format != 1) { - throw new \Mpdf\MpdfException("Unknown name table format " . $format); + throw new \Mpdf\Exception\FontException("Error loading font: Unknown name table format $format for font $this->filename"); } $numRecords = $this->read_ushort(); @@ -691,7 +691,7 @@ function extractInfo($debug = false, $BMPonly = false, $useOTL = 0) $opos = $this->_pos; $this->seek($string_data_offset + $offset); if ($length % 2 != 0) { - throw new \Mpdf\MpdfException("PostScript name is UTF-16BE string of odd length"); + throw new \Mpdf\Exception\FontException("Error loading font: PostScript name is UTF-16BE string of odd length for font $this->filename"); } $length /= 2; $N = ''; @@ -728,7 +728,7 @@ function extractInfo($debug = false, $BMPonly = false, $useOTL = 0) } if (!$psName) { - throw new \Mpdf\MpdfException("Could not find PostScript font name: " . $this->filename); + throw new \Mpdf\Exception\FontException("Error loading font: Could not find PostScript font name '$this->filename'"); } // CHECK IF psName valid (PadaukBook contains illegal characters in Name ID 6 i.e. Postscript Name) @@ -738,7 +738,7 @@ function extractInfo($debug = false, $BMPonly = false, $useOTL = 0) $c = $psName[$i]; $oc = ord($c); if ($oc > 126 || strpos(' [](){}<>/%', $c) !== false) { - //throw new \Mpdf\MpdfException("psName=".$psName." contains invalid character ".$c." ie U+".ord(c)); + //throw new \Mpdf\Exception\FontException("psName=".$psName." contains invalid character ".$c." ie U+".ord(c)); $psNameInvalid = true; break; } @@ -780,14 +780,14 @@ function extractInfo($debug = false, $BMPonly = false, $useOTL = 0) $ver_maj = $this->read_ushort(); $ver_min = $this->read_ushort(); if ($ver_maj != 1) { - throw new \Mpdf\MpdfException('Unknown head table version ' . $ver_maj . '.' . $ver_min); + throw new \Mpdf\Exception\FontException('Error loading font: Unknown head table version ' . $ver_maj . '.' . $ver_min); } $this->fontRevision = $this->read_ushort() . $this->read_ushort(); $this->skip(4); $magic = $this->read_ulong(); if ($magic !== 0x5F0F3CF5) { - throw new \Mpdf\MpdfException('Invalid head table magic ' . $magic); + throw new \Mpdf\Exception\FontException('Error loading font: Invalid head table magic ' . $magic); } $this->skip(2); } else { @@ -806,7 +806,7 @@ function extractInfo($debug = false, $BMPonly = false, $useOTL = 0) $indexToLocFormat = $this->read_ushort(); $glyphDataFormat = $this->read_ushort(); if ($glyphDataFormat != 0) { - throw new \Mpdf\MpdfException(sprintf('Unknown glyph data format %s', $glyphDataFormat)); + throw new \Mpdf\Exception\FontException(sprintf('Error loading font: Unknown glyph data format %s', $glyphDataFormat)); } // hhea metrics table @@ -938,7 +938,7 @@ function extractInfo($debug = false, $BMPonly = false, $useOTL = 0) if ($debug) { $ver_maj = $this->read_ushort(); if ($ver_maj < 1 || $ver_maj > 4) { - throw new \Mpdf\MpdfException(sprintf('Unknown post table version %s', $ver_maj)); + throw new \Mpdf\Exception\FontException(sprintf('Error loading font: Unknown post table version %s', $ver_maj)); } } else { $this->skip(4); @@ -966,7 +966,7 @@ function extractInfo($debug = false, $BMPonly = false, $useOTL = 0) if ($debug) { $ver_maj = $this->read_ushort(); if ($ver_maj != 1) { - throw new \Mpdf\MpdfException(sprintf('Unknown hhea table version %s', $ver_maj)); + throw new \Mpdf\Exception\FontException(sprintf('Error loading font: Unknown hhea table version %s', $ver_maj)); } $this->skip(28); } else { @@ -976,13 +976,13 @@ function extractInfo($debug = false, $BMPonly = false, $useOTL = 0) $metricDataFormat = $this->read_ushort(); if ($metricDataFormat != 0) { - throw new \Mpdf\MpdfException(sprintf('Unknown horizontal metric data format "%s"', $metricDataFormat)); + throw new \Mpdf\Exception\FontException(sprintf('Error loading font: Unknown horizontal metric data format "%s"', $metricDataFormat)); } $numberOfHMetrics = $this->read_ushort(); if ($numberOfHMetrics == 0) { - throw new \Mpdf\MpdfException('Number of horizontal metrics is 0'); + throw new \Mpdf\Exception\FontException('Error loading font: Number of horizontal metrics is 0'); } // maxp - Maximum profile table @@ -990,7 +990,7 @@ function extractInfo($debug = false, $BMPonly = false, $useOTL = 0) if ($debug) { $ver_maj = $this->read_ushort(); if ($ver_maj != 1) { - throw new \Mpdf\MpdfException(sprintf('Unknown maxp table version ', $ver_maj)); + throw new \Mpdf\Exception\FontException(sprintf('Error loading font: Unknown maxp table version %s', $ver_maj)); } } else { $this->skip(4); @@ -1028,7 +1028,7 @@ function extractInfo($debug = false, $BMPonly = false, $useOTL = 0) } if (!$unicode_cmap_offset) { - throw new \Mpdf\MpdfException(sprintf('Font "%s" does not have cmap for Unicode (platform 3, encoding 1, format 4, or platform 0, any encoding, format 4)', $this->filename)); + throw new \Mpdf\Exception\FontException(sprintf('Font "%s" does not have cmap for Unicode (platform 3, encoding 1, format 4, or platform 0, any encoding, format 4)', $this->filename)); } $sipset = false; @@ -1108,7 +1108,7 @@ function extractInfo($debug = false, $BMPonly = false, $useOTL = 0) $bctr++; } } else { - throw new \Mpdf\MpdfException(sprintf('The font "%s" does not have enough space to map all (unmapped) included glyphs into Private Use Area U+E000-U+F8FF', $names[1])); + throw new \Mpdf\Exception\FontException(sprintf('The font "%s" does not have enough space to map all (unmapped) included glyphs into Private Use Area U+E000-U+F8FF', $names[1])); } } @@ -1340,7 +1340,7 @@ function _getGDEFtables() $this->MarkGlyphSets = []; } } else { - throw new \Mpdf\MpdfException(sprintf('Unable to set font "%s" to use OTL as it does not include OTL tables (or at least not a GDEF table).', $this->filename)); + throw new \Mpdf\Exception\FontException(sprintf('Unable to set font "%s" to use OTL as it does not include OTL tables (or at least not a GDEF table).', $this->filename)); } $GSUB_offset = 0; @@ -1779,7 +1779,7 @@ function _getGSUBtables() } } } else { - throw new \Mpdf\MpdfException("GPOS Lookup Type " . $Lookup[$i]['Type'] . ", Format " . $SubstFormat . " not supported (ttfontsuni.php)."); + throw new \Mpdf\Exception\FontException("GPOS Lookup Type " . $Lookup[$i]['Type'] . ", Format " . $SubstFormat . " not supported (ttfontsuni.php)."); } } // LookupType 6: Chaining Contextual Substitution Subtable elseif ($Lookup[$i]['Type'] == 6) { @@ -1831,7 +1831,7 @@ function _getGSUBtables() } } } else { - throw new \Mpdf\MpdfException(sprintf('Lookup Type "%s" not supported.', $Lookup[$i]['Type'])); + throw new \Mpdf\Exception\FontException(sprintf('Lookup Type "%s" not supported.', $Lookup[$i]['Type'])); } } } @@ -1995,7 +1995,7 @@ function _getGSUBtables() $glyphs = $this->_getCoverage(); $Lookup[$i]['Subtable'][$c]['CoverageInputGlyphs'][] = implode("|", $glyphs); } - throw new \Mpdf\MpdfException("Lookup Type 5, SubstFormat 3 not tested. Please report this with the name of font used - " . $this->fontkey); + throw new \Mpdf\Exception\FontException("Lookup Type 5, SubstFormat 3 not tested. Please report this with the name of font used - " . $this->fontkey); } } // LookupType 6: Chaining Contextual Substitution Subtable elseif ($Lookup[$i]['Type'] == 6) { @@ -2960,7 +2960,7 @@ function _getGSUBignoreString($flag, $MarkFilteringSet) // Flag & 0x0010 = UseMarkFilteringSet if ($flag & 0x0010) { - throw new \Mpdf\MpdfException("This font " . $this->fontkey . " contains MarkGlyphSets - Not tested yet"); + throw new \Mpdf\Exception\FontException("This font " . $this->fontkey . " contains MarkGlyphSets - Not tested yet"); $str = $this->MarkGlyphSets[$MarkFilteringSet]; } @@ -3449,7 +3449,7 @@ function makeSubset($file, &$subset, $TTCfontID = 0, $debug = false, $useOTL = f $this->fh = fopen($file, 'rb'); if (!$this->fh) { - throw new \Mpdf\MpdfException(sprintf('Unable to open file %s', $file)); + throw new \Mpdf\Exception\FontException(sprintf('Unable to open file %s', $file)); } $this->_pos = 0; @@ -3470,7 +3470,7 @@ function makeSubset($file, &$subset, $TTCfontID = 0, $debug = false, $useOTL = f if ($TTCfontID > 0) { $this->version = $version = $this->read_ulong(); // TTC Header version now if (!in_array($version, [0x00010000, 0x00020000], true)) { - throw new \Mpdf\MpdfException(sprintf('Error parsing TrueType Collection: version=%s - %s', $version, $file)); + throw new \Mpdf\Exception\FontException(sprintf('Error parsing TrueType Collection: version=%s - %s', $version, $file)); } $this->numTTCFonts = $this->read_ulong(); for ($i = 1; $i <= $this->numTTCFonts; $i++) { @@ -3519,7 +3519,7 @@ function makeSubset($file, &$subset, $TTCfontID = 0, $debug = false, $useOTL = f } if (!$unicode_cmap_offset) { - throw new \Mpdf\MpdfException(sprintf('Font "%s" does not have Unicode cmap (platform 3, encoding 1, format 4, or platform 0 [any encoding] format 4)', $this->filename)); + throw new \Mpdf\Exception\FontException(sprintf('Font "%s" does not have Unicode cmap (platform 3, encoding 1, format 4, or platform 0 [any encoding] format 4)', $this->filename)); } $glyphToChar = []; @@ -3535,7 +3535,7 @@ function makeSubset($file, &$subset, $TTCfontID = 0, $debug = false, $useOTL = f $bctr++; } // Avoid overwriting a glyph already mapped in PUA if ($bctr > 0xF8FF) { - throw new \Mpdf\MpdfException($file . " : WARNING - Font cannot map all included glyphs into Private Use Area U+E000 - U+F8FF; cannot use useOTL on this font"); + throw new \Mpdf\Exception\FontException($file . " : WARNING - Font cannot map all included glyphs into Private Use Area U+E000 - U+F8FF; cannot use useOTL on this font"); } $glyphToChar[$gid][] = $bctr; $charToGlyph[$bctr] = $gid; @@ -3940,7 +3940,7 @@ function makeSubsetSIP($file, &$subset, $TTCfontID = 0, $debug = false, $useOTL $this->fh = fopen($file, 'rb'); if (!$this->fh) { - throw new \Mpdf\MpdfException(sprintf('Unable to open file "%s"', $file)); + throw new \Mpdf\Exception\FontException(sprintf('Unable to open file "%s"', $file)); } $this->filename = $file; @@ -3962,7 +3962,7 @@ function makeSubsetSIP($file, &$subset, $TTCfontID = 0, $debug = false, $useOTL if ($TTCfontID > 0) { $this->version = $version = $this->read_ulong(); // TTC Header version now if (!in_array($version, [0x00010000, 0x00020000])) { - throw new \Mpdf\MpdfException("ERROR - Error parsing TrueType Collection: version=" . $version . " - " . $file); + throw new \Mpdf\Exception\FontException("ERROR - Error parsing TrueType Collection: version=" . $version . " - " . $file); } $this->numTTCFonts = $this->read_ulong(); for ($i = 1; $i <= $this->numTTCFonts; $i++) { @@ -4021,7 +4021,7 @@ function makeSubsetSIP($file, &$subset, $TTCfontID = 0, $debug = false, $useOTL } if (!$unicode_cmap_offset) { - throw new \Mpdf\MpdfException(sprintf('Font "%s" does not have cmap for Unicode (platform 3, encoding 1, format 4, or platform 0, any encoding, format 4)', $file)); + throw new \Mpdf\Exception\FontException(sprintf('Font "%s" does not have cmap for Unicode (platform 3, encoding 1, format 4, or platform 0, any encoding, format 4)', $file)); } // Format 12 CMAP does characters above Unicode BMP i.e. some HKCS characters U+20000 and above @@ -4627,7 +4627,7 @@ function getLOCA($indexToLocFormat, $numGlyphs) $this->glyphPos[] = ($arr[$n + 1]); } } else { - throw new \Mpdf\MpdfException('Unknown location table format ' . $indexToLocFormat); + throw new \Mpdf\Exception\FontException('Unknown location table format ' . $indexToLocFormat); } } @@ -4753,7 +4753,7 @@ function repackageTTF($file, $TTCfontID = 0, $debug = false, $useOTL = false) $this->fh = fopen($file, 'rb'); if (!$this->fh) { - throw new \Mpdf\MpdfException(sprintf('Unable to open file "%s"', $file)); + throw new \Mpdf\Exception\FontException(sprintf('Unable to open file "%s"', $file)); } $this->_pos = 0; @@ -4774,7 +4774,7 @@ function repackageTTF($file, $TTCfontID = 0, $debug = false, $useOTL = false) if ($TTCfontID > 0) { $this->version = $version = $this->read_ulong(); // TTC Header version now if (!in_array($version, [0x00010000, 0x00020000], true)) { - throw new \Mpdf\MpdfException(sprintf('Error parsing TrueType Collection: version=%s - %s', $version, $file)); + throw new \Mpdf\Exception\FontException(sprintf('Error parsing TrueType Collection: version=%s - %s', $version, $file)); } $this->numTTCFonts = $this->read_ulong(); for ($i = 1; $i <= $this->numTTCFonts; $i++) { @@ -4821,7 +4821,7 @@ function repackageTTF($file, $TTCfontID = 0, $debug = false, $useOTL = false) } if (!$unicode_cmap_offset) { - throw new \Mpdf\MpdfException(sprintf('Font "%s" does not have cmap for Unicode (platform 3, encoding 1, format 4, or platform 0, any encoding, format 4)', $this->filename)); + throw new \Mpdf\Exception\FontException(sprintf('Font "%s" does not have cmap for Unicode (platform 3, encoding 1, format 4, or platform 0, any encoding, format 4)', $this->filename)); } $glyphToChar = []; @@ -4836,7 +4836,7 @@ function repackageTTF($file, $TTCfontID = 0, $debug = false, $useOTL = false) $bctr++; } // Avoid overwriting a glyph already mapped in PUA (6,400) if ($bctr > 0xF8FF) { - throw new \Mpdf\MpdfException("Problem. Trying to repackage TF file; not enough space for unmapped glyphs"); + throw new \Mpdf\Exception\FontException("Problem. Trying to repackage TF file; not enough space for unmapped glyphs"); } $glyphToChar[$gid][] = $bctr; $charToGlyph[$bctr] = $gid; diff --git a/vendor/mpdf/mpdf/src/TTFontFileAnalysis.php b/vendor/mpdf/mpdf/src/TTFontFileAnalysis.php index 343f2f5..2851ea0 100644 --- a/vendor/mpdf/mpdf/src/TTFontFileAnalysis.php +++ b/vendor/mpdf/mpdf/src/TTFontFileAnalysis.php @@ -152,7 +152,7 @@ function extractCoreInfo($file, $TTCfontID = 0) } $this->_pos = $opos; $this->seek($opos); - } else if ($platformId == 1 && $encodingId == 0 && $languageId == 0) { // Macintosh, Roman, English, PS Name + } elseif ($platformId == 1 && $encodingId == 0 && $languageId == 0) { // Macintosh, Roman, English, PS Name $opos = $this->_pos; $N = $this->get_chunk($string_data_offset + $offset, $length); $this->_pos = $opos; @@ -168,9 +168,9 @@ function extractCoreInfo($file, $TTCfontID = 0) } if ($names[6]) { $psName = preg_replace('/ /', '-', $names[6]); - } else if ($names[4]) { + } elseif ($names[4]) { $psName = preg_replace('/ /', '-', $names[4]); - } else if ($names[1]) { + } elseif ($names[1]) { $psName = preg_replace('/ /', '-', $names[1]); } else { $psName = ''; @@ -264,7 +264,7 @@ function extractCoreInfo($file, $TTCfontID = 0) $unicode_cmap_offset = $cmap_offset + $offset; } } - } else if ((($platformID == 3 && $encodingID == 10) || $platformID == 0)) { // Microsoft, Unicode Format 12 table HKCS + } elseif ((($platformID == 3 && $encodingID == 10) || $platformID == 0)) { // Microsoft, Unicode Format 12 table HKCS $format = $this->get_ushort($cmap_offset + $offset); if ($format == 12) { $unicode_cmap_offset = $cmap_offset + $offset; @@ -404,27 +404,27 @@ function extractCoreInfo($file, $TTCfontID = 0) if ($macStyle & (1 << 0)) { $bold = true; } // bit 0 bold - else if ($fsSelection & (1 << 5)) { + elseif ($fsSelection & (1 << 5)) { $bold = true; } // 5 BOLD Characters are emboldened if ($macStyle & (1 << 1)) { $italic = true; } // bit 1 italic - else if ($fsSelection & (1 << 0)) { + elseif ($fsSelection & (1 << 0)) { $italic = true; } // 0 ITALIC Font contains Italic characters, otherwise they are upright - else if ($this->italicAngle <> 0) { + elseif ($this->italicAngle <> 0) { $italic = true; } if ($isFixedPitch) { $ftype = 'mono'; - } else if ($sFamily > 0 && $sFamily < 8) { + } elseif ($sFamily > 0 && $sFamily < 8) { $ftype = 'serif'; - } else if ($sFamily == 8) { + } elseif ($sFamily == 8) { $ftype = 'sans'; - } else if ($sFamily == 10) { + } elseif ($sFamily == 10) { $ftype = 'cursive'; } // Use PANOSE @@ -435,7 +435,7 @@ function extractCoreInfo($file, $TTCfontID = 0) if (!$ftype) { if ($bSerifStyle > 1 && $bSerifStyle < 11) { $ftype = 'serif'; - } else if ($bSerifStyle > 10) { + } elseif ($bSerifStyle > 10) { $ftype = 'sans'; } } @@ -443,7 +443,7 @@ function extractCoreInfo($file, $TTCfontID = 0) if ($bProportion == 9 || $bProportion == 1) { $ftype = 'mono'; } // ==1 i.e. No Fit needed for OCR-a and -b - } else if ($bFamilyType == 3) { + } elseif ($bFamilyType == 3) { $ftype = 'cursive'; } } diff --git a/vendor/mpdf/mpdf/src/TableOfContents.php b/vendor/mpdf/mpdf/src/TableOfContents.php index 014ec1d..82ce748 100644 --- a/vendor/mpdf/mpdf/src/TableOfContents.php +++ b/vendor/mpdf/mpdf/src/TableOfContents.php @@ -148,7 +148,7 @@ public function TOCpagebreak( if (strtoupper($toc_id) == 'ALL') { $toc_id = '_mpdf_all'; - } else if (!$toc_id) { + } elseif (!$toc_id) { $toc_id = 0; } else { $toc_id = strtolower($toc_id); @@ -259,7 +259,7 @@ public function TOC( if (strtoupper($toc_id) == 'ALL') { $toc_id = '_mpdf_all'; - } else if (!$toc_id) { + } elseif (!$toc_id) { $toc_id = 0; } else { $toc_id = strtolower($toc_id); @@ -705,22 +705,22 @@ public function openTagTOCPAGEBREAK($attr) $this->m_TOC[$toc_id]['TOC_odd_header_value'] = $this->m_TOC[$toc_id]['TOC_even_header_value'] = $this->m_TOC[$toc_id]['TOC_odd_footer_value'] = $this->m_TOC[$toc_id]['TOC_even_footer_value'] = 0; if (isset($attr['TOC-ODD-HEADER-VALUE']) && ($attr['TOC-ODD-HEADER-VALUE'] == '1' || strtoupper($attr['TOC-ODD-HEADER-VALUE']) == 'ON')) { $this->m_TOC[$toc_id]['TOC_odd_header_value'] = 1; - } else if (isset($attr['TOC-ODD-HEADER-VALUE']) && ($attr['TOC-ODD-HEADER-VALUE'] == '-1' || strtoupper($attr['TOC-ODD-HEADER-VALUE']) == 'OFF')) { + } elseif (isset($attr['TOC-ODD-HEADER-VALUE']) && ($attr['TOC-ODD-HEADER-VALUE'] == '-1' || strtoupper($attr['TOC-ODD-HEADER-VALUE']) == 'OFF')) { $this->m_TOC[$toc_id]['TOC_odd_header_value'] = -1; } if (isset($attr['TOC-EVEN-HEADER-VALUE']) && ($attr['TOC-EVEN-HEADER-VALUE'] == '1' || strtoupper($attr['TOC-EVEN-HEADER-VALUE']) == 'ON')) { $this->m_TOC[$toc_id]['TOC_even_header_value'] = 1; - } else if (isset($attr['TOC-EVEN-HEADER-VALUE']) && ($attr['TOC-EVEN-HEADER-VALUE'] == '-1' || strtoupper($attr['TOC-EVEN-HEADER-VALUE']) == 'OFF')) { + } elseif (isset($attr['TOC-EVEN-HEADER-VALUE']) && ($attr['TOC-EVEN-HEADER-VALUE'] == '-1' || strtoupper($attr['TOC-EVEN-HEADER-VALUE']) == 'OFF')) { $this->m_TOC[$toc_id]['TOC_even_header_value'] = -1; } if (isset($attr['TOC-ODD-FOOTER-VALUE']) && ($attr['TOC-ODD-FOOTER-VALUE'] == '1' || strtoupper($attr['TOC-ODD-FOOTER-VALUE']) == 'ON')) { $this->m_TOC[$toc_id]['TOC_odd_footer_value'] = 1; - } else if (isset($attr['TOC-ODD-FOOTER-VALUE']) && ($attr['TOC-ODD-FOOTER-VALUE'] == '-1' || strtoupper($attr['TOC-ODD-FOOTER-VALUE']) == 'OFF')) { + } elseif (isset($attr['TOC-ODD-FOOTER-VALUE']) && ($attr['TOC-ODD-FOOTER-VALUE'] == '-1' || strtoupper($attr['TOC-ODD-FOOTER-VALUE']) == 'OFF')) { $this->m_TOC[$toc_id]['TOC_odd_footer_value'] = -1; } if (isset($attr['TOC-EVEN-FOOTER-VALUE']) && ($attr['TOC-EVEN-FOOTER-VALUE'] == '1' || strtoupper($attr['TOC-EVEN-FOOTER-VALUE']) == 'ON')) { $this->m_TOC[$toc_id]['TOC_even_footer_value'] = 1; - } else if (isset($attr['TOC-EVEN-FOOTER-VALUE']) && ($attr['TOC-EVEN-FOOTER-VALUE'] == '-1' || strtoupper($attr['TOC-EVEN-FOOTER-VALUE']) == 'OFF')) { + } elseif (isset($attr['TOC-EVEN-FOOTER-VALUE']) && ($attr['TOC-EVEN-FOOTER-VALUE'] == '-1' || strtoupper($attr['TOC-EVEN-FOOTER-VALUE']) == 'OFF')) { $this->m_TOC[$toc_id]['TOC_even_footer_value'] = -1; } if (isset($attr['TOC-RESETPAGENUM']) && $attr['TOC-RESETPAGENUM']) { @@ -817,23 +817,23 @@ public function openTagTOCPAGEBREAK($attr) $this->TOC_odd_header_value = $this->TOC_even_header_value = $this->TOC_odd_footer_value = $this->TOC_even_footer_value = 0; if (isset($attr['TOC-ODD-HEADER-VALUE']) && ($attr['TOC-ODD-HEADER-VALUE'] == '1' || strtoupper($attr['TOC-ODD-HEADER-VALUE']) == 'ON')) { $this->TOC_odd_header_value = 1; - } else if (isset($attr['TOC-ODD-HEADER-VALUE']) && ($attr['TOC-ODD-HEADER-VALUE'] == '-1' || strtoupper($attr['TOC-ODD-HEADER-VALUE']) == 'OFF')) { + } elseif (isset($attr['TOC-ODD-HEADER-VALUE']) && ($attr['TOC-ODD-HEADER-VALUE'] == '-1' || strtoupper($attr['TOC-ODD-HEADER-VALUE']) == 'OFF')) { $this->TOC_odd_header_value = -1; } if (isset($attr['TOC-EVEN-HEADER-VALUE']) && ($attr['TOC-EVEN-HEADER-VALUE'] == '1' || strtoupper($attr['TOC-EVEN-HEADER-VALUE']) == 'ON')) { $this->TOC_even_header_value = 1; - } else if (isset($attr['TOC-EVEN-HEADER-VALUE']) && ($attr['TOC-EVEN-HEADER-VALUE'] == '-1' || strtoupper($attr['TOC-EVEN-HEADER-VALUE']) == 'OFF')) { + } elseif (isset($attr['TOC-EVEN-HEADER-VALUE']) && ($attr['TOC-EVEN-HEADER-VALUE'] == '-1' || strtoupper($attr['TOC-EVEN-HEADER-VALUE']) == 'OFF')) { $this->TOC_even_header_value = -1; } if (isset($attr['TOC-ODD-FOOTER-VALUE']) && ($attr['TOC-ODD-FOOTER-VALUE'] == '1' || strtoupper($attr['TOC-ODD-FOOTER-VALUE']) == 'ON')) { $this->TOC_odd_footer_value = 1; - } else if (isset($attr['TOC-ODD-FOOTER-VALUE']) && ($attr['TOC-ODD-FOOTER-VALUE'] == '-1' || strtoupper($attr['TOC-ODD-FOOTER-VALUE']) == 'OFF')) { + } elseif (isset($attr['TOC-ODD-FOOTER-VALUE']) && ($attr['TOC-ODD-FOOTER-VALUE'] == '-1' || strtoupper($attr['TOC-ODD-FOOTER-VALUE']) == 'OFF')) { $this->TOC_odd_footer_value = -1; } if (isset($attr['TOC-EVEN-FOOTER-VALUE']) && ($attr['TOC-EVEN-FOOTER-VALUE'] == '1' || strtoupper($attr['TOC-EVEN-FOOTER-VALUE']) == 'ON')) { $this->TOC_even_footer_value = 1; - } else if (isset($attr['TOC-EVEN-FOOTER-VALUE']) && ($attr['TOC-EVEN-FOOTER-VALUE'] == '-1' || strtoupper($attr['TOC-EVEN-FOOTER-VALUE']) == 'OFF')) { + } elseif (isset($attr['TOC-EVEN-FOOTER-VALUE']) && ($attr['TOC-EVEN-FOOTER-VALUE'] == '-1' || strtoupper($attr['TOC-EVEN-FOOTER-VALUE']) == 'OFF')) { $this->TOC_even_footer_value = -1; } if (isset($attr['TOC-PAGE-SELECTOR']) && $attr['TOC-PAGE-SELECTOR']) { diff --git a/vendor/mpdf/mpdf/src/Tag/BarCode.php b/vendor/mpdf/mpdf/src/Tag/BarCode.php index e80fe59..65edb2a 100644 --- a/vendor/mpdf/mpdf/src/Tag/BarCode.php +++ b/vendor/mpdf/mpdf/src/Tag/BarCode.php @@ -151,7 +151,7 @@ public function open($attr, &$ahtml, &$ihtml) } if (isset($properties['VERTICAL-ALIGN'])) { - $objattr['vertical-align'] = self::ALIGN[strtolower($properties['VERTICAL-ALIGN'])]; + $objattr['vertical-align'] = $this->getAlign($properties['VERTICAL-ALIGN']); } if (isset($properties['COLOR']) && $properties['COLOR'] != '') { $objattr['color'] = $this->colorConverter->convert($properties['COLOR'], $this->mpdf->PDFAXwarnings); @@ -205,7 +205,7 @@ public function open($attr, &$ahtml, &$ihtml) $w = ($arrcode['maxw'] * $arrcode['nom-X'] * $objattr['bsize']) + $arrcode['quietL'] + $arrcode['quietR']; $h = ($arrcode['nom-H'] * $objattr['bsize']) + (2 * $arrcode['quietTB']); - } elseif (in_array($objattr['btype'], ['C128A', 'C128B', 'C128C', 'EAN128A', 'EAN128B', 'EAN128C', + } elseif (in_array($objattr['btype'], ['C128A', 'C128B', 'C128C', 'C128RAW', 'EAN128A', 'EAN128B', 'EAN128C', 'C39', 'C39+', 'C39E', 'C39E+', 'S25', 'S25+', 'I25', 'I25+', 'I25B', 'I25B+', 'C93', 'MSI', 'MSI+', 'CODABAR', 'CODE11'])) { diff --git a/vendor/mpdf/mpdf/src/Tag/BlockTag.php b/vendor/mpdf/mpdf/src/Tag/BlockTag.php index b42901d..14e6a64 100644 --- a/vendor/mpdf/mpdf/src/Tag/BlockTag.php +++ b/vendor/mpdf/mpdf/src/Tag/BlockTag.php @@ -126,7 +126,7 @@ public function open($attr, &$ahtml, &$ihtml) } // Cannot set block properties inside table - use Bold to indicate h1-h6 if ($tag === 'CENTER' && $this->mpdf->tdbegin) { - $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['a'] = self::ALIGN['center']; + $this->mpdf->cell[$this->mpdf->row][$this->mpdf->col]['a'] = $this->getAlign('center'); } $this->mpdf->InlineProperties['BLOCKINTABLE'] = $this->mpdf->saveInlineProperties(); @@ -165,7 +165,7 @@ public function open($attr, &$ahtml, &$ihtml) $this->mpdf->listcounter[$this->mpdf->listlvl] = 0; } - $this->mpdf->listcounter[$this->mpdf->listlvl] ++; + $this->mpdf->listcounter[$this->mpdf->listlvl]++; $this->mpdf->listitem = []; //if in table - output here as a tabletextbuffer //position:inside OR position:outside (always output in table as position:inside) @@ -398,7 +398,7 @@ public function open($attr, &$ahtml, &$ihtml) // mPDF 6 if (!empty($attr['ALIGN'])) { - $currblk['block-align'] = self::ALIGN[strtolower($attr['ALIGN'])]; + $currblk['block-align'] = $this->getAlign($attr['ALIGN']); } @@ -428,6 +428,9 @@ public function open($attr, &$ahtml, &$ihtml) $this->mpdf->ClearFloats(strtoupper($properties['CLEAR']), $this->mpdf->blklvl - 1); } // *CSS-FLOAT* + $currblk['padding_left'] = is_numeric($currblk['padding_left']) ? $currblk['padding_left'] : 0; + $currblk['padding_right'] = is_numeric($currblk['padding_right']) ? $currblk['padding_right'] : 0; + $container_w = $prevblk['inner_width']; $bdr = $currblk['border_right']['w']; $bdl = $currblk['border_left']['w']; @@ -444,7 +447,7 @@ public function open($attr, &$ahtml, &$ihtml) // Cancel Keep-Block-together $currblk['keep_block_together'] = false; - $this->mpdf->kt_y00 = ''; + $this->mpdf->kt_y00 = 0; $this->mpdf->keep_block_together = 0; $this->mpdf->blockContext++; @@ -495,7 +498,7 @@ public function open($attr, &$ahtml, &$ihtml) } elseif (isset($properties['FLOAT']) && strtoupper($properties['FLOAT']) === 'LEFT' && !$this->mpdf->ColActive) { // Cancel Keep-Block-together $currblk['keep_block_together'] = false; - $this->mpdf->kt_y00 = ''; + $this->mpdf->kt_y00 = 0; $this->mpdf->keep_block_together = 0; $this->mpdf->blockContext++; @@ -737,9 +740,6 @@ public function open($attr, &$ahtml, &$ihtml) $currblk['width'] = $this->mpdf->pgwidth - ($currblk['outer_right_margin'] + $currblk['outer_left_margin']); - $currblk['padding_left'] = is_numeric($currblk['padding_left']) ? $currblk['padding_left'] : 0; - $currblk['padding_right'] = is_numeric($currblk['padding_right']) ? $currblk['padding_right'] : 0; - $currblk['inner_width'] = $currblk['width'] - ($currblk['border_left']['w'] + $currblk['padding_left'] + $currblk['border_right']['w'] + $currblk['padding_right']); @@ -884,14 +884,17 @@ public function open($attr, &$ahtml, &$ihtml) } } - // mPDF 6 Lists if ($tag === 'LI') { - if ($this->mpdf->listlvl == 0) { //in case of malformed HTML code. Example:(...)

  • Content
  • Paragraph1

    (...) + if ($this->mpdf->listlvl == 0) { // in case of malformed HTML code. Example:(...)

  • Content
  • Paragraph1

    (...) $this->mpdf->listlvl++; // first depth level $this->mpdf->listcounter[$this->mpdf->listlvl] = 0; } - $this->mpdf->listcounter[$this->mpdf->listlvl] ++; + + if (!isset($attr['PAGEBREAKAVOIDCHECKED']) || !$attr['PAGEBREAKAVOIDCHECKED']) { + $this->mpdf->listcounter[$this->mpdf->listlvl]++; + } + $this->mpdf->listitem = []; // Listitem-type @@ -1221,7 +1224,7 @@ public function close(&$ahtml, &$ihtml) $page_break_after = $this->mpdf->blk[$this->mpdf->blklvl]['page_break_after']; } - //Reset values + // Reset values $this->mpdf->Reset(); if (isset($this->mpdf->blk[$this->mpdf->blklvl]['z-index']) && $this->mpdf->blk[$this->mpdf->blklvl]['z-index'] > 0) { @@ -1254,6 +1257,7 @@ public function close(&$ahtml, &$ihtml) $this->mpdf->pageoutput[$this->mpdf->page] = []; $this->mpdf->y = $this->mpdf->kt_y00; + $ihtml = $this->mpdf->blk[$this->mpdf->blklvl]['array_i'] - 1; $ahtml[$ihtml + 1] .= ' pagebreakavoidchecked="true";'; // avoid re-iterating; read in OpenTag() diff --git a/vendor/mpdf/mpdf/src/Tag/Columns.php b/vendor/mpdf/mpdf/src/Tag/Columns.php index 0e6bed4..c8c883a 100644 --- a/vendor/mpdf/mpdf/src/Tag/Columns.php +++ b/vendor/mpdf/mpdf/src/Tag/Columns.php @@ -47,7 +47,7 @@ public function open($attr, &$ahtml, &$ihtml) if ($attr['VALIGN'] === 'J') { $valign = 'J'; } else { - $valign = self::ALIGN[$attr['VALIGN']]; + $valign = $this->getAlign($attr['VALIGN']); } } else { $valign = ''; diff --git a/vendor/mpdf/mpdf/src/Tag/Hr.php b/vendor/mpdf/mpdf/src/Tag/Hr.php index 5155c63..89c880b 100644 --- a/vendor/mpdf/mpdf/src/Tag/Hr.php +++ b/vendor/mpdf/mpdf/src/Tag/Hr.php @@ -54,9 +54,9 @@ public function open($attr, &$ahtml, &$ihtml) $objattr['width'] = $this->sizeConverter->convert($attr['WIDTH'], $this->mpdf->blk[$this->mpdf->blklvl]['inner_width']); } if (isset($properties['TEXT-ALIGN'])) { - $objattr['align'] = self::ALIGN[strtolower($properties['TEXT-ALIGN'])]; + $objattr['align'] = $this->getAlign($properties['TEXT-ALIGN']); } elseif (isset($attr['ALIGN']) && $attr['ALIGN'] != '') { - $objattr['align'] = self::ALIGN[strtolower($attr['ALIGN'])]; + $objattr['align'] = $this->getAlign($attr['ALIGN']); } if (isset($properties['MARGIN-LEFT']) && strtolower($properties['MARGIN-LEFT']) === 'auto') { diff --git a/vendor/mpdf/mpdf/src/Tag/Img.php b/vendor/mpdf/mpdf/src/Tag/Img.php index cd7fc0d..5c68099 100644 --- a/vendor/mpdf/mpdf/src/Tag/Img.php +++ b/vendor/mpdf/mpdf/src/Tag/Img.php @@ -128,7 +128,7 @@ public function open($attr, &$ahtml, &$ihtml) } if (isset($properties['VERTICAL-ALIGN'])) { - $objattr['vertical-align'] = self::ALIGN[strtolower($properties['VERTICAL-ALIGN'])]; + $objattr['vertical-align'] = $this->getAlign($properties['VERTICAL-ALIGN']); } $w = 0; $h = 0; diff --git a/vendor/mpdf/mpdf/src/Tag/Input.php b/vendor/mpdf/mpdf/src/Tag/Input.php index 2b5b534..d98039c 100644 --- a/vendor/mpdf/mpdf/src/Tag/Input.php +++ b/vendor/mpdf/mpdf/src/Tag/Input.php @@ -81,9 +81,9 @@ public function open($attr, &$ahtml, &$ihtml) $objattr['fontsize'] = $this->mpdf->FontSizePt; if ($this->mpdf->useActiveForms) { if (isset($attr['ALIGN'])) { - $objattr['text_align'] = self::ALIGN[strtolower($attr['ALIGN'])]; + $objattr['text_align'] = $this->getAlign($attr['ALIGN']); } elseif (isset($properties['TEXT-ALIGN'])) { - $objattr['text_align'] = self::ALIGN[strtolower($properties['TEXT-ALIGN'])]; + $objattr['text_align'] = $this->getAlign($properties['TEXT-ALIGN']); } if (isset($properties['BORDER-TOP-COLOR'])) { $objattr['border-col'] = $this->colorConverter->convert($properties['BORDER-TOP-COLOR'], $this->mpdf->PDFAXwarnings); @@ -105,7 +105,7 @@ public function open($attr, &$ahtml, &$ihtml) } if ($properties['VERTICAL-ALIGN']) { - $objattr['vertical-align'] = self::ALIGN[strtolower($properties['VERTICAL-ALIGN'])]; + $objattr['vertical-align'] = $this->getAlign($properties['VERTICAL-ALIGN']); } switch (strtoupper($attr['TYPE'])) { @@ -199,7 +199,7 @@ public function open($attr, &$ahtml, &$ihtml) $objattr['padding_right'] = 0; if (isset($properties['VERTICAL-ALIGN'])) { - $objattr['vertical-align'] = self::ALIGN[strtolower($properties['VERTICAL-ALIGN'])]; + $objattr['vertical-align'] = $this->getAlign($properties['VERTICAL-ALIGN']); } $w = 0; diff --git a/vendor/mpdf/mpdf/src/Tag/Meter.php b/vendor/mpdf/mpdf/src/Tag/Meter.php index 80772cb..2ffff3d 100644 --- a/vendor/mpdf/mpdf/src/Tag/Meter.php +++ b/vendor/mpdf/mpdf/src/Tag/Meter.php @@ -176,7 +176,7 @@ public function open($attr, &$ahtml, &$ihtml) } if (isset($properties['VERTICAL-ALIGN'])) { - $objattr['vertical-align'] = self::ALIGN[strtolower($properties['VERTICAL-ALIGN'])]; + $objattr['vertical-align'] = $this->getAlign($properties['VERTICAL-ALIGN']); } $w = 0; $h = 0; @@ -348,7 +348,7 @@ protected function makeSVG($type, $value, $max, $min, $optimum, $low, $high) if ($value) { if ($min != $low && $value < $low) { $col = 'orange'; - } else if ($max != $high && $value > $high) { + } elseif ($max != $high && $value > $high) { $col = 'orange'; } else { $col = '#008800'; @@ -364,7 +364,7 @@ protected function makeSVG($type, $value, $max, $min, $optimum, $low, $high) $svg .= ''; $svg .= ''; - } else if ($type == '3') { + } elseif ($type == '3') { ///////////////////////////////////////////////////////////////////////////////////// ///////// CUSTOM ///////////////////////////////////////////////////////////////////////////////////// @@ -409,7 +409,7 @@ protected function makeSVG($type, $value, $max, $min, $optimum, $low, $high) if ($value) { if ($min != $low && $value < $low) { $col = 'orange'; - } else if ($max != $high && $value > $high) { + } elseif ($max != $high && $value > $high) { $col = 'orange'; } else { $col = 'orange'; @@ -482,15 +482,15 @@ protected function makeSVG($type, $value, $max, $min, $optimum, $low, $high) if ($optimum < $low) { if ($value < $low) { $barcol = 'url(#GrGREEN)'; - } else if ($value > $high) { + } elseif ($value > $high) { $barcol = 'url(#GrRED)'; } else { $barcol = 'url(#GrORANGE)'; } - } else if ($optimum > $high) { + } elseif ($optimum > $high) { if ($value < $low) { $barcol = 'url(#GrRED)'; - } else if ($value > $high) { + } elseif ($value > $high) { $barcol = 'url(#GrGREEN)'; } else { $barcol = 'url(#GrORANGE)'; @@ -498,7 +498,7 @@ protected function makeSVG($type, $value, $max, $min, $optimum, $low, $high) } else { if ($value < $low) { $barcol = 'url(#GrORANGE)'; - } else if ($value > $high) { + } elseif ($value > $high) { $barcol = 'url(#GrORANGE)'; } else { $barcol = 'url(#GrGREEN)'; diff --git a/vendor/mpdf/mpdf/src/Tag/Table.php b/vendor/mpdf/mpdf/src/Tag/Table.php index c4db1ee..8504e51 100644 --- a/vendor/mpdf/mpdf/src/Tag/Table.php +++ b/vendor/mpdf/mpdf/src/Tag/Table.php @@ -163,7 +163,7 @@ public function open($attr, &$ahtml, &$ihtml) } if (isset($attr['ALIGN']) && array_key_exists(strtolower($attr['ALIGN']), self::ALIGN)) { - $table['a'] = self::ALIGN[strtolower($attr['ALIGN'])]; + $table['a'] = $this->getAlign($attr['ALIGN']); } if (!$table['a']) { if ($table['direction'] === 'rtl') { @@ -190,10 +190,10 @@ public function open($attr, &$ahtml, &$ihtml) } if (isset($properties['VERTICAL-ALIGN']) && array_key_exists(strtolower($properties['VERTICAL-ALIGN']), self::ALIGN)) { - $table['va'] = self::ALIGN[strtolower($properties['VERTICAL-ALIGN'])]; + $table['va'] = $this->getAlign($properties['VERTICAL-ALIGN']); } if (isset($properties['TEXT-ALIGN']) && array_key_exists(strtolower($properties['TEXT-ALIGN']), self::ALIGN)) { - $table['txta'] = self::ALIGN[strtolower($properties['TEXT-ALIGN'])]; + $table['txta'] = $this->getAlign($properties['TEXT-ALIGN']); } if (!empty($properties['AUTOSIZE']) && $this->mpdf->tableLevel == 1) { @@ -276,7 +276,8 @@ public function open($attr, &$ahtml, &$ihtml) if (isset($properties['FONT-SIZE'])) { if ($this->mpdf->tableLevel > 1) { - $mmsize = $this->sizeConverter->convert($properties['FONT-SIZE'], $this->mpdf->base_table_properties['FONT-SIZE']); + $tableFontSize = $this->sizeConverter->convert($this->mpdf->base_table_properties['FONT-SIZE']); + $mmsize = $this->sizeConverter->convert($properties['FONT-SIZE'], $tableFontSize); } else { $mmsize = $this->sizeConverter->convert($properties['FONT-SIZE'], $this->mpdf->default_font_size / Mpdf::SCALE); } diff --git a/vendor/mpdf/mpdf/src/Tag/Tag.php b/vendor/mpdf/mpdf/src/Tag/Tag.php index 9f7c52c..094b2a4 100644 --- a/vendor/mpdf/mpdf/src/Tag/Tag.php +++ b/vendor/mpdf/mpdf/src/Tag/Tag.php @@ -114,6 +114,12 @@ public function getTagName() return strtoupper(str_replace('Mpdf\Tag\\', '', $tag)); } + protected function getAlign($property) + { + $property = strtolower($property); + return array_key_exists($property, self::ALIGN) ? self::ALIGN[$property] : ''; + } + abstract public function open($attr, &$ahtml, &$ihtml); abstract public function close(&$ahtml, &$ihtml); diff --git a/vendor/mpdf/mpdf/src/Tag/Td.php b/vendor/mpdf/mpdf/src/Tag/Td.php index 8124b90..47fb978 100644 --- a/vendor/mpdf/mpdf/src/Tag/Td.php +++ b/vendor/mpdf/mpdf/src/Tag/Td.php @@ -12,19 +12,23 @@ class Td extends Tag public function open($attr, &$ahtml, &$ihtml) { $tag = $this->getTagName(); + $this->mpdf->ignorefollowingspaces = true; $this->mpdf->lastoptionaltag = $tag; // Save current HTML specified optional endtag + $this->cssManager->tbCSSlvl++; + $this->mpdf->InlineProperties = []; $this->mpdf->InlineBDF = []; // mPDF 6 $this->mpdf->InlineBDFctr = 0; // mPDF 6 $this->mpdf->tdbegin = true; $this->mpdf->col++; + while (isset($this->mpdf->cell[$this->mpdf->row][$this->mpdf->col])) { $this->mpdf->col++; } - //Update number column + // Update number column if ($this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['nc'] < $this->mpdf->col + 1) { $this->mpdf->table[$this->mpdf->tableLevel][$this->mpdf->tbctr[$this->mpdf->tableLevel]]['nc'] = $this->mpdf->col + 1; } @@ -114,10 +118,10 @@ public function open($attr, &$ahtml, &$ihtml) // INHERITED THEAD CSS Properties if ($this->mpdf->tablethead) { if ($this->mpdf->thead_valign_default) { - $c['va'] = self::ALIGN[strtolower($this->mpdf->thead_valign_default)]; + $c['va'] = $this->getAlign($this->mpdf->thead_valign_default); } if ($this->mpdf->thead_textalign_default) { - $c['a'] = self::ALIGN[strtolower($this->mpdf->thead_textalign_default)]; + $c['a'] = $this->getAlign($this->mpdf->thead_textalign_default); } if ($this->mpdf->thead_font_weight === 'B') { $this->mpdf->SetStyle('B', true); @@ -133,10 +137,10 @@ public function open($attr, &$ahtml, &$ihtml) // INHERITED TFOOT CSS Properties if ($this->mpdf->tabletfoot) { if ($this->mpdf->tfoot_valign_default) { - $c['va'] = self::ALIGN[strtolower($this->mpdf->tfoot_valign_default)]; + $c['va'] = $this->getAlign($this->mpdf->tfoot_valign_default); } if ($this->mpdf->tfoot_textalign_default) { - $c['a'] = self::ALIGN[strtolower($this->mpdf->tfoot_textalign_default)]; + $c['a'] = $this->getAlign($this->mpdf->tfoot_textalign_default); } if ($this->mpdf->tfoot_font_weight === 'B') { $this->mpdf->SetStyle('B', true); @@ -195,9 +199,9 @@ public function open($attr, &$ahtml, &$ihtml) } /* -- END BACKGROUNDS -- */ if (isset($properties['VERTICAL-ALIGN'])) { - $c['va'] = self::ALIGN[strtolower($properties['VERTICAL-ALIGN'])]; + $c['va'] = $this->getAlign($properties['VERTICAL-ALIGN']); } elseif (isset($attr['VALIGN'])) { - $c['va'] = self::ALIGN[strtolower($attr['VALIGN'])]; + $c['va'] = $this->getAlign($attr['VALIGN']); } @@ -205,7 +209,7 @@ public function open($attr, &$ahtml, &$ihtml) if (0 === strpos($properties['TEXT-ALIGN'], 'D')) { $c['a'] = $properties['TEXT-ALIGN']; } else { - $c['a'] = self::ALIGN[strtolower($properties['TEXT-ALIGN'])]; + $c['a'] = $this->getAlign($properties['TEXT-ALIGN']); } } if (!empty($attr['ALIGN'])) { @@ -221,7 +225,7 @@ public function open($attr, &$ahtml, &$ihtml) $c['a'] = 'DPR'; } } else { - $c['a'] = self::ALIGN[strtolower($attr['ALIGN'])]; + $c['a'] = $this->getAlign($attr['ALIGN']); } } diff --git a/vendor/mpdf/mpdf/src/Tag/TextArea.php b/vendor/mpdf/mpdf/src/Tag/TextArea.php index 8685fab..017c548 100644 --- a/vendor/mpdf/mpdf/src/Tag/TextArea.php +++ b/vendor/mpdf/mpdf/src/Tag/TextArea.php @@ -75,9 +75,9 @@ public function open($attr, &$ahtml, &$ihtml) $objattr['fontsize'] = $this->mpdf->FontSizePt; if ($this->mpdf->useActiveForms) { if (isset($properties['TEXT-ALIGN'])) { - $objattr['text_align'] = self::ALIGN[strtolower($properties['TEXT-ALIGN'])]; + $objattr['text_align'] = $this->getAlign($properties['TEXT-ALIGN']); } elseif (isset($attr['ALIGN'])) { - $objattr['text_align'] = self::ALIGN[strtolower($attr['ALIGN'])]; + $objattr['text_align'] = $this->getAlign($attr['ALIGN']); } if (isset($properties['OVERFLOW']) && strtolower($properties['OVERFLOW']) === 'hidden') { $objattr['donotscroll'] = true; @@ -110,7 +110,7 @@ public function open($attr, &$ahtml, &$ihtml) ); } if (isset($properties['VERTICAL-ALIGN'])) { - $objattr['vertical-align'] = self::ALIGN[strtolower($properties['VERTICAL-ALIGN'])]; + $objattr['vertical-align'] = $this->getAlign($properties['VERTICAL-ALIGN']); } $colsize = 20; //HTML default value diff --git a/vendor/mpdf/mpdf/src/Utils/Arrays.php b/vendor/mpdf/mpdf/src/Utils/Arrays.php index 808913d..f27c83a 100644 --- a/vendor/mpdf/mpdf/src/Utils/Arrays.php +++ b/vendor/mpdf/mpdf/src/Utils/Arrays.php @@ -17,4 +17,76 @@ public static function get($array, $key, $default = null) return $default; } + + /** + * Returns an array of all k-combinations from an input array of n elements, where k equals 1..n. + * Elements will be sorted and unique in every combination. + * + * Example: array[one, two] will give: + * [ + * [one], + * [two], + * [one, two] + * ] + * @param array $array + * @return array + */ + public static function allUniqueSortedCombinations($array) + { + $input = array_unique($array); + if (count($input) <= 1) { + return [$input]; + } + + sort($input); + $combinations = []; + foreach ($input as $value) { + $combinations[] = [$value]; + } + + $n = count($input); + for ($k = 2; $k <= $n; $k++) { + $combinations = array_merge($combinations, self::combinations($input, $k)); + } + + return $combinations; + } + + /** + * Returns an array of unique k-combinations from an input array. + * + * Example: array=[one, two, three] and k=2 will give: + * [ + * [one, two], + * [one, three] + * ] + * @param array $array + * @param int $k + * @return array + */ + public static function combinations($array, $k) + { + $n = count($array); + $combinations = []; + $indexes = range(0, $k - 1); + $maxIndexes = range($n - $k, $n - 1); + do { + $combination = []; + foreach ($indexes as $index) { + $combination[] = $array[$index]; + } + $combinations[] = $combination; + + $anotherCombination = false; + for ($i = $k - 1; $i >= 0; $i--) { + if ($indexes[$i] < $maxIndexes[$i]) { + $indexes[$i]++; + $anotherCombination = true; + break; + } + } + } while ($anotherCombination); + + return $combinations; + } } diff --git a/vendor/mpdf/mpdf/src/Writer/MetadataWriter.php b/vendor/mpdf/mpdf/src/Writer/MetadataWriter.php index 1cda749..01caafc 100644 --- a/vendor/mpdf/mpdf/src/Writer/MetadataWriter.php +++ b/vendor/mpdf/mpdf/src/Writer/MetadataWriter.php @@ -54,7 +54,7 @@ public function writeMetadata() // _putmetadata { $this->writer->object(); $this->mpdf->MetadataRoot = $this->mpdf->n; - $Producer = 'mPDF ' . Mpdf::VERSION; + $Producer = 'mPDF' . ($this->mpdf->exposeVersion ? (' ' . Mpdf::VERSION) : ''); $z = date('O'); // +0200 $offset = substr($z, 0, 3) . ':' . substr($z, 3, 2); $CreationDate = date('Y-m-d\TH:i:s') . $offset; // 2006-03-10T10:47:26-05:00 2006-06-19T09:05:17Z @@ -151,7 +151,7 @@ public function writeMetadata() // _putmetadata public function writeInfo() // _putinfo { - $this->writer->write('/Producer ' . $this->writer->utf16BigEndianTextString('mPDF ' . $this->getVersionString())); + $this->writer->write('/Producer ' . $this->writer->utf16BigEndianTextString('mPDF' . ($this->mpdf->exposeVersion ? (' ' . $this->getVersionString()) : ''))); if (!empty($this->mpdf->title)) { $this->writer->write('/Title ' . $this->writer->utf16BigEndianTextString($this->mpdf->title)); @@ -177,10 +177,9 @@ public function writeInfo() // _putinfo $this->writer->write('/' . $key . ' ' . $this->writer->utf16BigEndianTextString($value)); } - $z = date('O'); // +0200 - $offset = substr($z, 0, 3) . "'" . substr($z, 3, 2) . "'"; - $this->writer->write('/CreationDate ' . $this->writer->string(date('YmdHis') . $offset)); - $this->writer->write('/ModDate ' . $this->writer->string(date('YmdHis') . $offset)); + $now = PdfDate::format(time()); + $this->writer->write('/CreationDate ' . $this->writer->string('D:' . $now)); + $this->writer->write('/ModDate ' . $this->writer->string('D:' . $now)); if ($this->mpdf->PDFX) { $this->writer->write('/Trapped/False'); $this->writer->write('/GTS_PDFXVersion(PDF/X-1a:2003)'); @@ -342,6 +341,8 @@ public function writeCatalog() //_putcatalog $this->writer->write('/OpenAction [3 0 R /XYZ null null 1]'); } elseif (!is_string($this->mpdf->ZoomMode)) { $this->writer->write('/OpenAction [3 0 R /XYZ null null ' . ($this->mpdf->ZoomMode / 100) . ']'); + } elseif ($this->mpdf->ZoomMode === 'none') { + // do not write any zoom mode / OpenAction } else { $this->writer->write('/OpenAction [3 0 R /XYZ null null null]'); } @@ -454,23 +455,29 @@ public function writeCatalog() //_putcatalog } if ($this->mpdf->hasOC || count($this->mpdf->layers)) { + $p = $v = $h = $l = $loff = $lall = $as = ''; + if ($this->mpdf->hasOC) { + if (($this->mpdf->hasOC & 1) === 1) { $p = $this->mpdf->n_ocg_print . ' 0 R'; } + if (($this->mpdf->hasOC & 2) === 2) { $v = $this->mpdf->n_ocg_view . ' 0 R'; } + if (($this->mpdf->hasOC & 4) === 4) { $h = $this->mpdf->n_ocg_hidden . ' 0 R'; } + $as = "<> <>"; } if (count($this->mpdf->layers)) { foreach ($this->mpdf->layers as $k => $layer) { - if (strtolower($this->mpdf->layerDetails[$k]['state']) === 'hidden') { + if (isset($this->mpdf->layerDetails[$k]) && strtolower($this->mpdf->layerDetails[$k]['state']) === 'hidden') { $loff .= $layer['n'] . ' 0 R '; } else { $l .= $layer['n'] . ' 0 R '; @@ -478,11 +485,14 @@ public function writeCatalog() //_putcatalog $lall .= $layer['n'] . ' 0 R '; } } + $this->writer->write("/OCProperties <writer->write("/Order [$v $p $h $lall] "); + if ($as) { $this->writer->write("/AS [$as] "); } + $this->writer->write('>>>>'); } } @@ -642,12 +652,12 @@ public function writeAnnotations() // _putannots $annotcolor = ' /C ['; if (isset($pl['opt']['c']) && $pl['opt']['c']) { $col = $pl['opt']['c']; - if ($col{0} == 3 || $col{0} == 5) { - $annotcolor .= sprintf('%.3F %.3F %.3F', ord($col{1}) / 255, ord($col{2}) / 255, ord($col{3}) / 255); - } elseif ($col{0} == 1) { - $annotcolor .= sprintf('%.3F', ord($col{1}) / 255); - } elseif ($col{0} == 4 || $col{0} == 6) { - $annotcolor .= sprintf('%.3F %.3F %.3F %.3F', ord($col{1}) / 100, ord($col{2}) / 100, ord($col{3}) / 100, ord($col{4}) / 100); + if ($col[0] == 3 || $col[0] == 5) { + $annotcolor .= sprintf('%.3F %.3F %.3F', ord($col[1]) / 255, ord($col[2]) / 255, ord($col[3]) / 255); + } elseif ($col[0] == 1) { + $annotcolor .= sprintf('%.3F', ord($col[1]) / 255); + } elseif ($col[0] == 4 || $col[0] == 6) { + $annotcolor .= sprintf('%.3F %.3F %.3F %.3F', ord($col[1]) / 100, ord($col[2]) / 100, ord($col[3]) / 100, ord($col[4]) / 100); } else { $annotcolor .= '1 1 0'; } diff --git a/vendor/myclabs/deep-copy/.gitattributes b/vendor/myclabs/deep-copy/.gitattributes deleted file mode 100755 index 8018068..0000000 --- a/vendor/myclabs/deep-copy/.gitattributes +++ /dev/null @@ -1,7 +0,0 @@ -# Auto detect text files and perform LF normalization -* text=auto - -*.png binary - -tests/ export-ignore -phpunit.xml.dist export-ignore diff --git a/vendor/myclabs/deep-copy/.github/FUNDING.yml b/vendor/myclabs/deep-copy/.github/FUNDING.yml new file mode 100644 index 0000000..b8da664 --- /dev/null +++ b/vendor/myclabs/deep-copy/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: "packagist/myclabs/deep-copy" +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/vendor/myclabs/deep-copy/.gitignore b/vendor/myclabs/deep-copy/.gitignore deleted file mode 100755 index eef72f7..0000000 --- a/vendor/myclabs/deep-copy/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/composer.phar -/composer.lock -/vendor/* diff --git a/vendor/myclabs/deep-copy/.scrutinizer.yml b/vendor/myclabs/deep-copy/.scrutinizer.yml deleted file mode 100644 index 6934299..0000000 --- a/vendor/myclabs/deep-copy/.scrutinizer.yml +++ /dev/null @@ -1,4 +0,0 @@ -build: - environment: - variables: - COMPOSER_ROOT_VERSION: '1.8.0' diff --git a/vendor/myclabs/deep-copy/.travis.yml b/vendor/myclabs/deep-copy/.travis.yml deleted file mode 100755 index 88f9d2e..0000000 --- a/vendor/myclabs/deep-copy/.travis.yml +++ /dev/null @@ -1,40 +0,0 @@ -language: php - -sudo: false - -env: - global: - - COMPOSER_ROOT_VERSION=1.8.0 - -php: - - '7.1' - - '7.2' - - nightly - -matrix: - fast_finish: true - include: - - php: '7.1' - env: COMPOSER_FLAGS="--prefer-lowest" - allow_failures: - - php: nightly - -cache: - directories: - - $HOME/.composer/cache/files - -install: - - composer update --no-interaction --no-progress --no-suggest --prefer-dist $COMPOSER_FLAGS - - wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.0/coveralls.phar - -before_script: - - mkdir -p build/logs - -script: - - vendor/bin/phpunit --coverage-clover build/logs/clover.xml - -after_script: - - php coveralls.phar -v - -notifications: - email: false diff --git a/vendor/myclabs/deep-copy/README.md b/vendor/myclabs/deep-copy/README.md index 7abe5dc..007ad5b 100644 --- a/vendor/myclabs/deep-copy/README.md +++ b/vendor/myclabs/deep-copy/README.md @@ -7,11 +7,6 @@ DeepCopy helps you create deep copies (clones) of your objects. It is designed t [![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/myclabs/DeepCopy/badges/quality-score.png?s=2747100c19b275f93a777e3297c6c12d1b68b934)](https://scrutinizer-ci.com/g/myclabs/DeepCopy/) [![Total Downloads](https://poser.pugx.org/myclabs/deep-copy/downloads.svg)](https://packagist.org/packages/myclabs/deep-copy) - -**You are browsing the 1.x version, this version is in maintenance mode only. Please check the new -[2.x](https://github.com/myclabs/DeepCopy/tree/2.x) version.** - - ## Table of Contents 1. [How](#how) @@ -374,3 +369,7 @@ Running the tests is simple: ```php vendor/bin/phpunit ``` + +### Support + +Get professional support via [the Tidelift Subscription](https://tidelift.com/subscription/pkg/packagist-myclabs-deep-copy?utm_source=packagist-myclabs-deep-copy&utm_medium=referral&utm_campaign=readme). diff --git a/vendor/myclabs/deep-copy/fixtures/f001/A.php b/vendor/myclabs/deep-copy/fixtures/f001/A.php deleted file mode 100644 index 648d5df..0000000 --- a/vendor/myclabs/deep-copy/fixtures/f001/A.php +++ /dev/null @@ -1,20 +0,0 @@ -aProp; - } - - public function setAProp($prop) - { - $this->aProp = $prop; - - return $this; - } -} diff --git a/vendor/myclabs/deep-copy/fixtures/f001/B.php b/vendor/myclabs/deep-copy/fixtures/f001/B.php deleted file mode 100644 index 462bb44..0000000 --- a/vendor/myclabs/deep-copy/fixtures/f001/B.php +++ /dev/null @@ -1,20 +0,0 @@ -bProp; - } - - public function setBProp($prop) - { - $this->bProp = $prop; - - return $this; - } -} diff --git a/vendor/myclabs/deep-copy/fixtures/f002/A.php b/vendor/myclabs/deep-copy/fixtures/f002/A.php deleted file mode 100644 index d9aa5c3..0000000 --- a/vendor/myclabs/deep-copy/fixtures/f002/A.php +++ /dev/null @@ -1,33 +0,0 @@ -prop1; - } - - public function setProp1($prop) - { - $this->prop1 = $prop; - - return $this; - } - - public function getProp2() - { - return $this->prop2; - } - - public function setProp2($prop) - { - $this->prop2 = $prop; - - return $this; - } -} diff --git a/vendor/myclabs/deep-copy/fixtures/f003/Foo.php b/vendor/myclabs/deep-copy/fixtures/f003/Foo.php deleted file mode 100644 index 9cd7622..0000000 --- a/vendor/myclabs/deep-copy/fixtures/f003/Foo.php +++ /dev/null @@ -1,26 +0,0 @@ -name = $name; - } - - public function getProp() - { - return $this->prop; - } - - public function setProp($prop) - { - $this->prop = $prop; - - return $this; - } -} \ No newline at end of file diff --git a/vendor/myclabs/deep-copy/fixtures/f004/UnclonableItem.php b/vendor/myclabs/deep-copy/fixtures/f004/UnclonableItem.php deleted file mode 100644 index 82c6c67..0000000 --- a/vendor/myclabs/deep-copy/fixtures/f004/UnclonableItem.php +++ /dev/null @@ -1,13 +0,0 @@ -cloned = true; - } -} diff --git a/vendor/myclabs/deep-copy/fixtures/f006/A.php b/vendor/myclabs/deep-copy/fixtures/f006/A.php deleted file mode 100644 index d9efb11..0000000 --- a/vendor/myclabs/deep-copy/fixtures/f006/A.php +++ /dev/null @@ -1,26 +0,0 @@ -aProp; - } - - public function setAProp($prop) - { - $this->aProp = $prop; - - return $this; - } - - public function __clone() - { - $this->cloned = true; - } -} diff --git a/vendor/myclabs/deep-copy/fixtures/f006/B.php b/vendor/myclabs/deep-copy/fixtures/f006/B.php deleted file mode 100644 index 1f80b3d..0000000 --- a/vendor/myclabs/deep-copy/fixtures/f006/B.php +++ /dev/null @@ -1,26 +0,0 @@ -bProp; - } - - public function setBProp($prop) - { - $this->bProp = $prop; - - return $this; - } - - public function __clone() - { - $this->cloned = true; - } -} diff --git a/vendor/myclabs/deep-copy/fixtures/f007/FooDateInterval.php b/vendor/myclabs/deep-copy/fixtures/f007/FooDateInterval.php deleted file mode 100644 index e16bc6a..0000000 --- a/vendor/myclabs/deep-copy/fixtures/f007/FooDateInterval.php +++ /dev/null @@ -1,15 +0,0 @@ -cloned = true; - } -} diff --git a/vendor/myclabs/deep-copy/fixtures/f007/FooDateTimeZone.php b/vendor/myclabs/deep-copy/fixtures/f007/FooDateTimeZone.php deleted file mode 100644 index 6f4e61f..0000000 --- a/vendor/myclabs/deep-copy/fixtures/f007/FooDateTimeZone.php +++ /dev/null @@ -1,15 +0,0 @@ -cloned = true; - } -} diff --git a/vendor/myclabs/deep-copy/fixtures/f008/A.php b/vendor/myclabs/deep-copy/fixtures/f008/A.php deleted file mode 100644 index 88471d0..0000000 --- a/vendor/myclabs/deep-copy/fixtures/f008/A.php +++ /dev/null @@ -1,18 +0,0 @@ -foo = $foo; - } - - public function getFoo() - { - return $this->foo; - } -} diff --git a/vendor/myclabs/deep-copy/fixtures/f008/B.php b/vendor/myclabs/deep-copy/fixtures/f008/B.php deleted file mode 100644 index 6053092..0000000 --- a/vendor/myclabs/deep-copy/fixtures/f008/B.php +++ /dev/null @@ -1,7 +0,0 @@ -useCloneMethod = $useCloneMethod; + $this->addTypeFilter(new ArrayObjectFilter($this), new TypeMatcher(ArrayObject::class)); $this->addTypeFilter(new DateIntervalFilter(), new TypeMatcher(DateInterval::class)); $this->addTypeFilter(new SplDoublyLinkedListFilter($this), new TypeMatcher(SplDoublyLinkedList::class)); } @@ -99,6 +102,14 @@ public function addFilter(Filter $filter, Matcher $matcher) ]; } + public function prependFilter(Filter $filter, Matcher $matcher) + { + array_unshift($this->filters, [ + 'matcher' => $matcher, + 'filter' => $filter, + ]); + } + public function addTypeFilter(TypeFilter $filter, TypeMatcher $matcher) { $this->typeFilters[] = [ @@ -229,6 +240,12 @@ function ($object) { } $property->setAccessible(true); + + // Ignore uninitialized properties (for PHP >7.4) + if (method_exists($property, 'isInitialized') && !$property->isInitialized($object)) { + return; + } + $propertyValue = $property->getValue($object); // Copy the property diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/ArrayObjectFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/ArrayObjectFilter.php new file mode 100644 index 0000000..dbc25a5 --- /dev/null +++ b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/ArrayObjectFilter.php @@ -0,0 +1,36 @@ +copier = $copier; + } + + /** + * {@inheritdoc} + */ + public function apply($arrayObject) + { + return new ArrayObject( + $this->copier->copy($arrayObject->getArrayCopy()), + $arrayObject->getFlags(), + $arrayObject->getIteratorClass() + ); + } +} + diff --git a/vendor/psr/log/.gitignore b/vendor/psr/log/.gitignore deleted file mode 100644 index 22d0d82..0000000 --- a/vendor/psr/log/.gitignore +++ /dev/null @@ -1 +0,0 @@ -vendor diff --git a/vendor/psr/log/Psr/Log/LoggerInterface.php b/vendor/psr/log/Psr/Log/LoggerInterface.php index 5ea7243..2206cfd 100644 --- a/vendor/psr/log/Psr/Log/LoggerInterface.php +++ b/vendor/psr/log/Psr/Log/LoggerInterface.php @@ -22,8 +22,8 @@ interface LoggerInterface /** * System is unusable. * - * @param string $message - * @param array $context + * @param string $message + * @param mixed[] $context * * @return void */ @@ -35,8 +35,8 @@ public function emergency($message, array $context = array()); * Example: Entire website down, database unavailable, etc. This should * trigger the SMS alerts and wake you up. * - * @param string $message - * @param array $context + * @param string $message + * @param mixed[] $context * * @return void */ @@ -47,8 +47,8 @@ public function alert($message, array $context = array()); * * Example: Application component unavailable, unexpected exception. * - * @param string $message - * @param array $context + * @param string $message + * @param mixed[] $context * * @return void */ @@ -58,8 +58,8 @@ public function critical($message, array $context = array()); * Runtime errors that do not require immediate action but should typically * be logged and monitored. * - * @param string $message - * @param array $context + * @param string $message + * @param mixed[] $context * * @return void */ @@ -71,8 +71,8 @@ public function error($message, array $context = array()); * Example: Use of deprecated APIs, poor use of an API, undesirable things * that are not necessarily wrong. * - * @param string $message - * @param array $context + * @param string $message + * @param mixed[] $context * * @return void */ @@ -81,8 +81,8 @@ public function warning($message, array $context = array()); /** * Normal but significant events. * - * @param string $message - * @param array $context + * @param string $message + * @param mixed[] $context * * @return void */ @@ -93,8 +93,8 @@ public function notice($message, array $context = array()); * * Example: User logs in, SQL logs. * - * @param string $message - * @param array $context + * @param string $message + * @param mixed[] $context * * @return void */ @@ -103,8 +103,8 @@ public function info($message, array $context = array()); /** * Detailed debug information. * - * @param string $message - * @param array $context + * @param string $message + * @param mixed[] $context * * @return void */ @@ -113,11 +113,13 @@ public function debug($message, array $context = array()); /** * Logs with an arbitrary level. * - * @param mixed $level - * @param string $message - * @param array $context + * @param mixed $level + * @param string $message + * @param mixed[] $context * * @return void + * + * @throws \Psr\Log\InvalidArgumentException */ public function log($level, $message, array $context = array()); } diff --git a/vendor/psr/log/Psr/Log/LoggerTrait.php b/vendor/psr/log/Psr/Log/LoggerTrait.php index 867225d..e392fef 100644 --- a/vendor/psr/log/Psr/Log/LoggerTrait.php +++ b/vendor/psr/log/Psr/Log/LoggerTrait.php @@ -135,6 +135,8 @@ public function debug($message, array $context = array()) * @param array $context * * @return void + * + * @throws \Psr\Log\InvalidArgumentException */ abstract public function log($level, $message, array $context = array()); } diff --git a/vendor/psr/log/Psr/Log/NullLogger.php b/vendor/psr/log/Psr/Log/NullLogger.php index d8cd682..c8f7293 100644 --- a/vendor/psr/log/Psr/Log/NullLogger.php +++ b/vendor/psr/log/Psr/Log/NullLogger.php @@ -20,6 +20,8 @@ class NullLogger extends AbstractLogger * @param array $context * * @return void + * + * @throws \Psr\Log\InvalidArgumentException */ public function log($level, $message, array $context = array()) { diff --git a/vendor/psr/log/Psr/Log/Test/DummyTest.php b/vendor/psr/log/Psr/Log/Test/DummyTest.php new file mode 100644 index 0000000..9638c11 --- /dev/null +++ b/vendor/psr/log/Psr/Log/Test/DummyTest.php @@ -0,0 +1,18 @@ +assertEquals($expected, $this->getLogs()); } } - -class DummyTest -{ - public function __toString() - { - } -} diff --git a/vendor/psr/log/Psr/Log/Test/TestLogger.php b/vendor/psr/log/Psr/Log/Test/TestLogger.php index 0cdffe4..1be3230 100644 --- a/vendor/psr/log/Psr/Log/Test/TestLogger.php +++ b/vendor/psr/log/Psr/Log/Test/TestLogger.php @@ -142,5 +142,6 @@ public function __call($method, $args) public function reset() { $this->records = []; + $this->recordsByLevel = []; } } diff --git a/vendor/psr/log/README.md b/vendor/psr/log/README.md index 5571a25..a9f20c4 100644 --- a/vendor/psr/log/README.md +++ b/vendor/psr/log/README.md @@ -38,6 +38,12 @@ class Foo if ($this->logger) { $this->logger->info('Doing work'); } + + try { + $this->doSomethingElse(); + } catch (Exception $exception) { + $this->logger->error('Oh no!', array('exception' => $exception)); + } // do something useful } diff --git a/vendor/psr/log/composer.json b/vendor/psr/log/composer.json index 87934d7..3f6d4ee 100644 --- a/vendor/psr/log/composer.json +++ b/vendor/psr/log/composer.json @@ -20,7 +20,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } } } diff --git a/vendor/setasign/fpdi/LICENSE.txt b/vendor/setasign/fpdi/LICENSE.txt index 7e75850..45672fa 100644 --- a/vendor/setasign/fpdi/LICENSE.txt +++ b/vendor/setasign/fpdi/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2017 Setasign - Jan Slabon, https://www.setasign.com +Copyright (c) 2020 Setasign GmbH & Co. KG, https://www.setasign.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/setasign/fpdi/README.md b/vendor/setasign/fpdi/README.md index 42856df..082122f 100644 --- a/vendor/setasign/fpdi/README.md +++ b/vendor/setasign/fpdi/README.md @@ -18,75 +18,39 @@ FPDI can also be used as an extension for [TCPDF](https://github.com/tecnickcom/ ## Installation with [Composer](https://packagist.org/packages/setasign/fpdi) -Because FPDI can be used with FPDF, TCPDF or tFPDF we didn't added a fixed dependency in the main -composer.json file but we added metadata packages for -[FPDF](https://github.com/Setasign/FPDI-FPDF), -[TCPDF](https://github.com/Setasign/FPDI-TCPDF) and -[tFPDF](https://github.com/Setasign/FPDI-tFPDF). - -### Evaluate Dependencies Automatically - -For FPDF add following [package](https://github.com/Setasign/FPDI-FPDF) to your composer.json: -```json -{ - "require": { - "setasign/fpdi-fpdf": "^2.0" - } -} -``` - -For TCPDF add following [package](https://github.com/Setasign/FPDI-TCPDF) to your composer.json: -```json -{ - "require": { - "setasign/fpdi-tcpdf": "^2.0" - } -} -``` - -For tFPDF add following [package](https://github.com/Setasign/FPDI-tFPDF) to your composer.json: -```json -{ - "require": { - "setasign/fpdi-tfpdf": "^2.1" - } -} -``` - -### Manual Dependencies - -If you don't want to use the metadata packages, it is up to you to add the dependencies to your -composer.json file. +Because FPDI can be used with FPDF, TCPDF or tFPDF we haven't added a fixed dependency in the main +composer.json file. You need to add the dependency to the PDF generation library of your choice +yourself. To use FPDI with FPDF include following in your composer.json file: ```json { "require": { - "setasign/fpdf": "^1.8", + "setasign/fpdf": "1.8.*", "setasign/fpdi": "^2.0" } } ``` -If you want to use TCPDF, your have to update your composer.json respectively to: +If you want to use TCPDF, you have to update your composer.json to: ```json { "require": { - "tecnickcom/tcpdf": "^6.2", + "tecnickcom/tcpdf": "6.2.*", "setasign/fpdi": "^2.0" } } ``` -If you want to use tFPDF, your have to update your composer.json respectively to: +If you want to use tFPDF, you have to update your composer.json to: ```json { "require": { - "tecnickcom/tfpdf": "1.25", - "setasign/fpdi": "^2.1" + "setasign/tfpdf": "1.31.*", + "setasign/fpdi": "^2.3" } } ``` diff --git a/vendor/setasign/fpdi/SECURITY.md b/vendor/setasign/fpdi/SECURITY.md new file mode 100644 index 0000000..da9c516 --- /dev/null +++ b/vendor/setasign/fpdi/SECURITY.md @@ -0,0 +1,5 @@ +## Security contact information + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. diff --git a/vendor/setasign/fpdi/composer.json b/vendor/setasign/fpdi/composer.json index 58f7931..72ea24e 100644 --- a/vendor/setasign/fpdi/composer.json +++ b/vendor/setasign/fpdi/composer.json @@ -18,6 +18,9 @@ "php": "^5.6 || ^7.0", "ext-zlib": "*" }, + "conflict": { + "setasign/tfpdf": "<1.31" + }, "authors": [ { "name": "Jan Slabon", @@ -31,16 +34,13 @@ } ], "suggest": { - "setasign/fpdf": "FPDI will extend this class but as it is also possible to use TCPDF or tFPDF as an alternative. There's no fixed dependency configured.", - "setasign/fpdi-fpdf": "Use this package to automatically evaluate dependencies to FPDF.", - "setasign/fpdi-tcpdf": "Use this package to automatically evaluate dependencies to TCPDF.", - "setasign/fpdi-tfpdf": "Use this package to automatically evaluate dependencies to tFPDF." + "setasign/fpdf": "FPDI will extend this class but as it is also possible to use TCPDF or tFPDF as an alternative. There's no fixed dependency configured." }, "require-dev": { "phpunit/phpunit": "~5.7", "setasign/fpdf": "~1.8", "tecnickcom/tcpdf": "~6.2", - "setasign/tfpdf": "1.25" + "setasign/tfpdf": "1.31" }, "autoload-dev": { "psr-4": { diff --git a/vendor/setasign/fpdi/src/FpdfTpl.php b/vendor/setasign/fpdi/src/FpdfTpl.php index fba7c6a..d70583d 100644 --- a/vendor/setasign/fpdi/src/FpdfTpl.php +++ b/vendor/setasign/fpdi/src/FpdfTpl.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/FpdfTplTrait.php b/vendor/setasign/fpdi/src/FpdfTplTrait.php index 9fb0d9a..10f9d5c 100644 --- a/vendor/setasign/fpdi/src/FpdfTplTrait.php +++ b/vendor/setasign/fpdi/src/FpdfTplTrait.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/Fpdi.php b/vendor/setasign/fpdi/src/Fpdi.php index b49c103..3db4b55 100644 --- a/vendor/setasign/fpdi/src/Fpdi.php +++ b/vendor/setasign/fpdi/src/Fpdi.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ @@ -30,7 +30,7 @@ class Fpdi extends FpdfTpl * * @string */ - const VERSION = '2.2.0'; + const VERSION = '2.3.1'; protected function _enddoc() { diff --git a/vendor/setasign/fpdi/src/FpdiException.php b/vendor/setasign/fpdi/src/FpdiException.php index d126c14..dcd52c9 100644 --- a/vendor/setasign/fpdi/src/FpdiException.php +++ b/vendor/setasign/fpdi/src/FpdiException.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/FpdiTrait.php b/vendor/setasign/fpdi/src/FpdiTrait.php index 0bdbc03..86c1e80 100644 --- a/vendor/setasign/fpdi/src/FpdiTrait.php +++ b/vendor/setasign/fpdi/src/FpdiTrait.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/CrossReference/AbstractReader.php b/vendor/setasign/fpdi/src/PdfParser/CrossReference/AbstractReader.php index 1d5c579..d314c6d 100644 --- a/vendor/setasign/fpdi/src/PdfParser/CrossReference/AbstractReader.php +++ b/vendor/setasign/fpdi/src/PdfParser/CrossReference/AbstractReader.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/CrossReference/CrossReference.php b/vendor/setasign/fpdi/src/PdfParser/CrossReference/CrossReference.php index 95674ce..fe1ed71 100644 --- a/vendor/setasign/fpdi/src/PdfParser/CrossReference/CrossReference.php +++ b/vendor/setasign/fpdi/src/PdfParser/CrossReference/CrossReference.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ @@ -235,8 +235,16 @@ protected function initReaderInstance($initValue) } if ($initValue instanceof PdfIndirectObject) { - // check for encryption - $stream = PdfStream::ensure($initValue->value); + try { + $stream = PdfStream::ensure($initValue->value); + + } catch (PdfTypeException $e) { + throw new CrossReferenceException( + 'Invalid object type at xref reference offset.', + CrossReferenceException::INVALID_DATA, + $e + ); + } $type = PdfDictionary::get($stream->value, 'Type'); if ($type->value !== 'XRef') { diff --git a/vendor/setasign/fpdi/src/PdfParser/CrossReference/CrossReferenceException.php b/vendor/setasign/fpdi/src/PdfParser/CrossReference/CrossReferenceException.php index 3fa9b33..ff8f11f 100644 --- a/vendor/setasign/fpdi/src/PdfParser/CrossReference/CrossReferenceException.php +++ b/vendor/setasign/fpdi/src/PdfParser/CrossReference/CrossReferenceException.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/CrossReference/FixedReader.php b/vendor/setasign/fpdi/src/PdfParser/CrossReference/FixedReader.php index f96b979..0faec1a 100644 --- a/vendor/setasign/fpdi/src/PdfParser/CrossReference/FixedReader.php +++ b/vendor/setasign/fpdi/src/PdfParser/CrossReference/FixedReader.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/CrossReference/LineReader.php b/vendor/setasign/fpdi/src/PdfParser/CrossReference/LineReader.php index 31a96be..7b4a129 100644 --- a/vendor/setasign/fpdi/src/PdfParser/CrossReference/LineReader.php +++ b/vendor/setasign/fpdi/src/PdfParser/CrossReference/LineReader.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/CrossReference/ReaderInterface.php b/vendor/setasign/fpdi/src/PdfParser/CrossReference/ReaderInterface.php index 84b2267..9a99b00 100644 --- a/vendor/setasign/fpdi/src/PdfParser/CrossReference/ReaderInterface.php +++ b/vendor/setasign/fpdi/src/PdfParser/CrossReference/ReaderInterface.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/Filter/Ascii85.php b/vendor/setasign/fpdi/src/PdfParser/Filter/Ascii85.php index 3541cca..eeb0698 100644 --- a/vendor/setasign/fpdi/src/PdfParser/Filter/Ascii85.php +++ b/vendor/setasign/fpdi/src/PdfParser/Filter/Ascii85.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ @@ -29,6 +29,8 @@ public function decode($data) $state = 0; $chn = null; + $data = \preg_replace('/\s/', '', $data); + $l = \strlen($data); /** @noinspection ForeachInvariantsInspection */ @@ -44,13 +46,12 @@ public function decode($data) if ($ch === 126 && isset($data[$k + 1]) && (\ord($data[$k + 1]) & 0xFF) === 62) { break; } - if (\preg_match('/^\s$/', \chr($ch))) { - continue; - } + if ($ch === 122 /* z */ && $state === 0) { $out .= \chr(0) . \chr(0) . \chr(0) . \chr(0); continue; } + if ($ch < 33 /* ! */ || $ch > 117 /* u */) { throw new Ascii85Exception( 'Illegal character found while ASCII85 decode.', diff --git a/vendor/setasign/fpdi/src/PdfParser/Filter/Ascii85Exception.php b/vendor/setasign/fpdi/src/PdfParser/Filter/Ascii85Exception.php index 898276c..a4b494a 100644 --- a/vendor/setasign/fpdi/src/PdfParser/Filter/Ascii85Exception.php +++ b/vendor/setasign/fpdi/src/PdfParser/Filter/Ascii85Exception.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/Filter/AsciiHex.php b/vendor/setasign/fpdi/src/PdfParser/Filter/AsciiHex.php index 3868584..efa8b56 100644 --- a/vendor/setasign/fpdi/src/PdfParser/Filter/AsciiHex.php +++ b/vendor/setasign/fpdi/src/PdfParser/Filter/AsciiHex.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/Filter/FilterException.php b/vendor/setasign/fpdi/src/PdfParser/Filter/FilterException.php index a41ce69..e3d19e1 100644 --- a/vendor/setasign/fpdi/src/PdfParser/Filter/FilterException.php +++ b/vendor/setasign/fpdi/src/PdfParser/Filter/FilterException.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/Filter/FilterInterface.php b/vendor/setasign/fpdi/src/PdfParser/Filter/FilterInterface.php index 0323471..475f7ec 100644 --- a/vendor/setasign/fpdi/src/PdfParser/Filter/FilterInterface.php +++ b/vendor/setasign/fpdi/src/PdfParser/Filter/FilterInterface.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/Filter/Flate.php b/vendor/setasign/fpdi/src/PdfParser/Filter/Flate.php index c12f619..f34353e 100644 --- a/vendor/setasign/fpdi/src/PdfParser/Filter/Flate.php +++ b/vendor/setasign/fpdi/src/PdfParser/Filter/Flate.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ @@ -42,21 +42,30 @@ public function decode($data) $oData = $data; $data = @((\strlen($data) > 0) ? \gzuncompress($data) : ''); if ($data === false) { + // let's try if the checksum is CRC32 + $fh = fopen('php://temp', 'w+b'); + fwrite($fh, "\x1f\x8b\x08\x00\x00\x00\x00\x00" . $oData); + stream_filter_append($fh, 'zlib.inflate', STREAM_FILTER_READ, ['window' => 30]); + fseek($fh, 0); + $data = stream_get_contents($fh); + fclose($fh); + + if ($data) { + return $data; + } + // Try this fallback - $tries = 1; - while ($tries < 10 && ($data === false || \strlen($data) < (\strlen($oData) - $tries - 1))) { - $data = @(\gzinflate(\substr($oData, $tries))); + $tries = 0; + + $oDataLen = strlen($oData); + while ($tries < 6 && ($data === false || (strlen($data) < (strlen($oDataLen) - $tries - 1)))) { + $data = @(gzinflate(substr($oData, $tries))); $tries++; } - if ($data === false) { - // let's try if the checksum is CRC32 - $fh = fopen('php://temp', 'w+b'); - \fwrite($fh, "\x1f\x8b\x08\x00\x00\x00\x00\x00" . $oData); - \stream_filter_append($fh, 'zlib.inflate', \STREAM_FILTER_READ, ['window' => 30]); - \fseek($fh, 0); - $data = \stream_get_contents($fh); - \fclose($fh); + // let's use this fallback only if the $data is longer than the original data + if (strlen($data) > ($oDataLen - $tries - 1)) { + return $data; } if (!$data) { diff --git a/vendor/setasign/fpdi/src/PdfParser/Filter/FlateException.php b/vendor/setasign/fpdi/src/PdfParser/Filter/FlateException.php index d44281d..3488f99 100644 --- a/vendor/setasign/fpdi/src/PdfParser/Filter/FlateException.php +++ b/vendor/setasign/fpdi/src/PdfParser/Filter/FlateException.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/Filter/Lzw.php b/vendor/setasign/fpdi/src/PdfParser/Filter/Lzw.php index f4df719..77848ea 100644 --- a/vendor/setasign/fpdi/src/PdfParser/Filter/Lzw.php +++ b/vendor/setasign/fpdi/src/PdfParser/Filter/Lzw.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/Filter/LzwException.php b/vendor/setasign/fpdi/src/PdfParser/Filter/LzwException.php index e822bc9..0eaa3be 100644 --- a/vendor/setasign/fpdi/src/PdfParser/Filter/LzwException.php +++ b/vendor/setasign/fpdi/src/PdfParser/Filter/LzwException.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/PdfParser.php b/vendor/setasign/fpdi/src/PdfParser/PdfParser.php index cccdfb6..64efb1c 100644 --- a/vendor/setasign/fpdi/src/PdfParser/PdfParser.php +++ b/vendor/setasign/fpdi/src/PdfParser/PdfParser.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/PdfParserException.php b/vendor/setasign/fpdi/src/PdfParser/PdfParserException.php index 476bccd..56c731f 100644 --- a/vendor/setasign/fpdi/src/PdfParser/PdfParserException.php +++ b/vendor/setasign/fpdi/src/PdfParser/PdfParserException.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/StreamReader.php b/vendor/setasign/fpdi/src/PdfParser/StreamReader.php index 27de6d9..65089a8 100644 --- a/vendor/setasign/fpdi/src/PdfParser/StreamReader.php +++ b/vendor/setasign/fpdi/src/PdfParser/StreamReader.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/Tokenizer.php b/vendor/setasign/fpdi/src/PdfParser/Tokenizer.php index ebf0d0b..b2bbf70 100644 --- a/vendor/setasign/fpdi/src/PdfParser/Tokenizer.php +++ b/vendor/setasign/fpdi/src/PdfParser/Tokenizer.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/Type/PdfArray.php b/vendor/setasign/fpdi/src/PdfParser/Type/PdfArray.php index 9cf449a..906cd3a 100644 --- a/vendor/setasign/fpdi/src/PdfParser/Type/PdfArray.php +++ b/vendor/setasign/fpdi/src/PdfParser/Type/PdfArray.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/Type/PdfBoolean.php b/vendor/setasign/fpdi/src/PdfParser/Type/PdfBoolean.php index 5f746b7..07ab0fe 100644 --- a/vendor/setasign/fpdi/src/PdfParser/Type/PdfBoolean.php +++ b/vendor/setasign/fpdi/src/PdfParser/Type/PdfBoolean.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/Type/PdfDictionary.php b/vendor/setasign/fpdi/src/PdfParser/Type/PdfDictionary.php index 46b669d..0f07dc5 100644 --- a/vendor/setasign/fpdi/src/PdfParser/Type/PdfDictionary.php +++ b/vendor/setasign/fpdi/src/PdfParser/Type/PdfDictionary.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/Type/PdfHexString.php b/vendor/setasign/fpdi/src/PdfParser/Type/PdfHexString.php index 793fa43..8a0cb23 100644 --- a/vendor/setasign/fpdi/src/PdfParser/Type/PdfHexString.php +++ b/vendor/setasign/fpdi/src/PdfParser/Type/PdfHexString.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/Type/PdfIndirectObject.php b/vendor/setasign/fpdi/src/PdfParser/Type/PdfIndirectObject.php index a5bd2ac..188fe0d 100644 --- a/vendor/setasign/fpdi/src/PdfParser/Type/PdfIndirectObject.php +++ b/vendor/setasign/fpdi/src/PdfParser/Type/PdfIndirectObject.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/Type/PdfIndirectObjectReference.php b/vendor/setasign/fpdi/src/PdfParser/Type/PdfIndirectObjectReference.php index c6a67a0..0892898 100644 --- a/vendor/setasign/fpdi/src/PdfParser/Type/PdfIndirectObjectReference.php +++ b/vendor/setasign/fpdi/src/PdfParser/Type/PdfIndirectObjectReference.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/Type/PdfName.php b/vendor/setasign/fpdi/src/PdfParser/Type/PdfName.php index 6be7d0e..cbf1833 100644 --- a/vendor/setasign/fpdi/src/PdfParser/Type/PdfName.php +++ b/vendor/setasign/fpdi/src/PdfParser/Type/PdfName.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ @@ -49,8 +49,8 @@ static public function unescape($value) if (strpos($value, '#') === false) return $value; - return preg_replace_callback('/#[a-fA-F\d]{2}/', function($matches) { - return chr(hexdec($matches[0])); + return preg_replace_callback('/#([a-fA-F\d]{2})/', function($matches) { + return chr(hexdec($matches[1])); }, $value); } diff --git a/vendor/setasign/fpdi/src/PdfParser/Type/PdfNull.php b/vendor/setasign/fpdi/src/PdfParser/Type/PdfNull.php index 3dbe37c..762a52c 100644 --- a/vendor/setasign/fpdi/src/PdfParser/Type/PdfNull.php +++ b/vendor/setasign/fpdi/src/PdfParser/Type/PdfNull.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/Type/PdfNumeric.php b/vendor/setasign/fpdi/src/PdfParser/Type/PdfNumeric.php index e9bf287..5146fc6 100644 --- a/vendor/setasign/fpdi/src/PdfParser/Type/PdfNumeric.php +++ b/vendor/setasign/fpdi/src/PdfParser/Type/PdfNumeric.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/Type/PdfStream.php b/vendor/setasign/fpdi/src/PdfParser/Type/PdfStream.php index 4b9300b..615ac50 100644 --- a/vendor/setasign/fpdi/src/PdfParser/Type/PdfStream.php +++ b/vendor/setasign/fpdi/src/PdfParser/Type/PdfStream.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ @@ -208,6 +208,13 @@ protected function extractStream() } } + // There are streams in the wild, which have only white signs in them but need to be parsed manually due + // to a problem encountered before (e.g. Length === 0). We should set them to empty streams to avoid problems + // in further processing (e.g. applying of filters). + if (trim($buffer) === '') { + $buffer = ''; + } + return $buffer; } diff --git a/vendor/setasign/fpdi/src/PdfParser/Type/PdfString.php b/vendor/setasign/fpdi/src/PdfParser/Type/PdfString.php index f933b1a..e6011ac 100644 --- a/vendor/setasign/fpdi/src/PdfParser/Type/PdfString.php +++ b/vendor/setasign/fpdi/src/PdfParser/Type/PdfString.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/Type/PdfToken.php b/vendor/setasign/fpdi/src/PdfParser/Type/PdfToken.php index 4abda09..c532938 100644 --- a/vendor/setasign/fpdi/src/PdfParser/Type/PdfToken.php +++ b/vendor/setasign/fpdi/src/PdfParser/Type/PdfToken.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/Type/PdfType.php b/vendor/setasign/fpdi/src/PdfParser/Type/PdfType.php index 6ce3c8c..548dba2 100644 --- a/vendor/setasign/fpdi/src/PdfParser/Type/PdfType.php +++ b/vendor/setasign/fpdi/src/PdfParser/Type/PdfType.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfParser/Type/PdfTypeException.php b/vendor/setasign/fpdi/src/PdfParser/Type/PdfTypeException.php index 8327220..1ee20ec 100644 --- a/vendor/setasign/fpdi/src/PdfParser/Type/PdfTypeException.php +++ b/vendor/setasign/fpdi/src/PdfParser/Type/PdfTypeException.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfReader/DataStructure/Rectangle.php b/vendor/setasign/fpdi/src/PdfReader/DataStructure/Rectangle.php index 51f531f..8774f9f 100644 --- a/vendor/setasign/fpdi/src/PdfReader/DataStructure/Rectangle.php +++ b/vendor/setasign/fpdi/src/PdfReader/DataStructure/Rectangle.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfReader/Page.php b/vendor/setasign/fpdi/src/PdfReader/Page.php index 0c2fb56..645f8d0 100644 --- a/vendor/setasign/fpdi/src/PdfReader/Page.php +++ b/vendor/setasign/fpdi/src/PdfReader/Page.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfReader/PageBoundaries.php b/vendor/setasign/fpdi/src/PdfReader/PageBoundaries.php index aaeaf91..3842c88 100644 --- a/vendor/setasign/fpdi/src/PdfReader/PageBoundaries.php +++ b/vendor/setasign/fpdi/src/PdfReader/PageBoundaries.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/PdfReader/PdfReader.php b/vendor/setasign/fpdi/src/PdfReader/PdfReader.php index 896d44d..0b39407 100644 --- a/vendor/setasign/fpdi/src/PdfReader/PdfReader.php +++ b/vendor/setasign/fpdi/src/PdfReader/PdfReader.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ @@ -14,6 +14,7 @@ use setasign\Fpdi\PdfParser\PdfParserException; use setasign\Fpdi\PdfParser\Type\PdfArray; use setasign\Fpdi\PdfParser\Type\PdfDictionary; +use setasign\Fpdi\PdfParser\Type\PdfIndirectObject; use setasign\Fpdi\PdfParser\Type\PdfIndirectObjectReference; use setasign\Fpdi\PdfParser\Type\PdfNumeric; use setasign\Fpdi\PdfParser\Type\PdfType; @@ -39,7 +40,7 @@ class PdfReader /** * Indirect objects of resolved pages. * - * @var PdfIndirectObjectReference[] + * @var PdfIndirectObjectReference[]|PdfIndirectObject[] */ protected $pages = []; @@ -59,7 +60,6 @@ public function __construct(PdfParser $parser) public function __destruct() { if ($this->parser !== null) { - /** @noinspection PhpInternalEntityUsedInspection */ $this->parser->cleanUp(); } } @@ -165,9 +165,21 @@ public function getPage($pageNumber) $page = $this->parser->getIndirectObject($page->value); $dict = PdfType::resolve($page, $this->parser); $type = PdfDictionary::get($dict, 'Type'); + if ($type->value === 'Pages') { $kids = PdfType::resolve(PdfDictionary::get($dict, 'Kids'), $this->parser); - $page = $this->pages[$pageNumber - 1] = $readPages($kids); + try { + $page = $this->pages[$pageNumber - 1] = $readPages($kids); + } catch (PdfReaderException $e) { + if ($e->getCode() !== PdfReaderException::KIDS_EMPTY) { + throw $e; + } + + // let's reset the pages array and read all page objects + $this->pages = []; + $this->readPages(true); + $page = $this->pages[$pageNumber - 1]; + } } else { $this->pages[$pageNumber - 1] = $page; } @@ -179,24 +191,25 @@ public function getPage($pageNumber) /** * Walk the page tree and resolve all indirect objects of all pages. * - * @throws PdfTypeException + * @param bool $readAll * @throws CrossReferenceException * @throws PdfParserException + * @throws PdfTypeException */ - protected function readPages() + protected function readPages($readAll = false) { if (\count($this->pages) > 0) { return; } - $readPages = function ($kids, $count) use (&$readPages) { + $readPages = function ($kids, $count) use (&$readPages, $readAll) { $kids = PdfArray::ensure($kids); - $isLeaf = $count->value === \count($kids->value); + $isLeaf = ($count->value === \count($kids->value)); foreach ($kids->value as $reference) { $reference = PdfIndirectObjectReference::ensure($reference); - if ($isLeaf) { + if (!$readAll && $isLeaf) { $this->pages[] = $reference; continue; } diff --git a/vendor/setasign/fpdi/src/PdfReader/PdfReaderException.php b/vendor/setasign/fpdi/src/PdfReader/PdfReaderException.php index c1159ba..c33d567 100644 --- a/vendor/setasign/fpdi/src/PdfReader/PdfReaderException.php +++ b/vendor/setasign/fpdi/src/PdfReader/PdfReaderException.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/Tcpdf/Fpdi.php b/vendor/setasign/fpdi/src/Tcpdf/Fpdi.php index 47886ea..b0486b1 100644 --- a/vendor/setasign/fpdi/src/Tcpdf/Fpdi.php +++ b/vendor/setasign/fpdi/src/Tcpdf/Fpdi.php @@ -34,7 +34,7 @@ class Fpdi extends \TCPDF * * @string */ - const VERSION = '2.2.0'; + const VERSION = '2.3.1'; /** * A counter for template ids. diff --git a/vendor/setasign/fpdi/src/TcpdfFpdi.php b/vendor/setasign/fpdi/src/TcpdfFpdi.php index 6b617a1..b366daa 100644 --- a/vendor/setasign/fpdi/src/TcpdfFpdi.php +++ b/vendor/setasign/fpdi/src/TcpdfFpdi.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ diff --git a/vendor/setasign/fpdi/src/Tfpdf/FpdfTpl.php b/vendor/setasign/fpdi/src/Tfpdf/FpdfTpl.php index 13ca8d4..bf37484 100644 --- a/vendor/setasign/fpdi/src/Tfpdf/FpdfTpl.php +++ b/vendor/setasign/fpdi/src/Tfpdf/FpdfTpl.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ @@ -20,80 +20,5 @@ */ class FpdfTpl extends \tFPDF { - use FpdfTplTrait { - _putimages as _protectedPutimages; - _putxobjectdict as _protectedPutxobjectdict; - } - - /** - * Make the method public as in tFPDF. - */ - public function _putimages() - { - $this->_protectedPutimages(); - } - - /** - * Make the method public as in tFPDF. - */ - public function _putxobjectdict() - { - $this->_protectedPutxobjectdict(); - } - - /** - * Set the page format of the current page. - * - * @param array $size An array with two values defining the size. - * @param string $orientation "L" for landscape, "P" for portrait. - * @throws \BadMethodCallException - */ - public function setPageFormat($size, $orientation) - { - if ($this->currentTemplateId !== null) { - throw new \BadMethodCallException('The page format cannot be changed when writing to a template.'); - } - - if (!\in_array($orientation, ['P', 'L'], true)) { - throw new \InvalidArgumentException(\sprintf( - 'Invalid page orientation "%s"! Only "P" and "L" are allowed!', - $orientation - )); - } - - $size = $this->_getpagesize($size); - - if ($orientation != $this->CurOrientation - || $size[0] != $this->CurPageSize[0] - || $size[1] != $this->CurPageSize[1] - ) { - // New size or orientation - if ($orientation === 'P') { - $this->w = $size[0]; - $this->h = $size[1]; - } else { - $this->w = $size[1]; - $this->h = $size[0]; - } - $this->wPt = $this->w * $this->k; - $this->hPt = $this->h * $this->k; - $this->PageBreakTrigger = $this->h - $this->bMargin; - $this->CurOrientation = $orientation; - $this->CurPageSize = $size; - - $this->PageSizes[$this->page] = array($this->wPt, $this->hPt); - } - } - - /** - * @inheritdoc - */ - protected function _put($s, $newLine = true) - { - if ($newLine) { - $this->buffer .= $s . "\n"; - } else { - $this->buffer .= $s; - } - } + use FpdfTplTrait; } \ No newline at end of file diff --git a/vendor/setasign/fpdi/src/Tfpdf/Fpdi.php b/vendor/setasign/fpdi/src/Tfpdf/Fpdi.php index f22625f..37e0f44 100644 --- a/vendor/setasign/fpdi/src/Tfpdf/Fpdi.php +++ b/vendor/setasign/fpdi/src/Tfpdf/Fpdi.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ @@ -31,7 +31,7 @@ class Fpdi extends FpdfTpl * * @string */ - const VERSION = '2.2.0'; + const VERSION = '2.3.1'; public function _enddoc() { @@ -133,7 +133,7 @@ public function _putimages() /** * @inheritdoc */ - public function _putxobjectdict() + protected function _putxobjectdict() { foreach ($this->importedPages as $key => $pageData) { $this->_put('/' . $pageData['id'] . ' ' . $pageData['objectNumber'] . ' 0 R'); @@ -145,20 +145,12 @@ public function _putxobjectdict() /** * @inheritdoc */ - public function _newobj($n = null) + protected function _put($s, $newLine = true) { - // Begin a new object - if($n === null) - $n = ++$this->n; - $this->offsets[$n] = $this->_getoffset(); - $this->_put($n.' 0 obj'); - } - - /** - * @inheritdoc - */ - protected function _getoffset() - { - return strlen($this->buffer); + if ($newLine) { + $this->buffer .= $s . "\n"; + } else { + $this->buffer .= $s; + } } } \ No newline at end of file diff --git a/vendor/setasign/fpdi/src/autoload.php b/vendor/setasign/fpdi/src/autoload.php index fd7d472..b649e8b 100644 --- a/vendor/setasign/fpdi/src/autoload.php +++ b/vendor/setasign/fpdi/src/autoload.php @@ -3,7 +3,7 @@ * This file is part of FPDI * * @package setasign\Fpdi - * @copyright Copyright (c) 2019 Setasign - Jan Slabon (https://www.setasign.com) + * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com) * @license http://opensource.org/licenses/mit-license The MIT License */ From 00d90f03cf7c24613e1128b810b9217c65cc583a Mon Sep 17 00:00:00 2001 From: Clifford Paulick Date: Wed, 10 Jun 2020 09:23:15 -0500 Subject: [PATCH 2/3] proper composer name (to not fail w Composer 2.0+) --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c7d803b..7ab7c3e 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "tribe-ext-pdf-tickets", + "name": "moderntribe/tribe-ext-pdf-tickets", "description": "Event Tickets' RSVP, Tribe Commerce PayPal, WooCommerce, and/or Easy Digital Downloads ticket emails will become PDF files saved to your Uploads directory and then get attached to the ticket emails.", "type": "project", "require": { From 86b7615f047c0cf4a74f01e1bc4a344dfd54dbb5 Mon Sep 17 00:00:00 2001 From: Clifford Paulick Date: Wed, 10 Jun 2020 09:26:38 -0500 Subject: [PATCH 3/3] changelog, update WC tested version --- readme.txt | 11 ++++++++--- tribe-ext-pdf-tickets.php | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/readme.txt b/readme.txt index 50cbb42..e069e94 100644 --- a/readme.txt +++ b/readme.txt @@ -3,9 +3,9 @@ Contributors: ModernTribe Donate link: http://m.tri.be/29 Tags: events, calendar Requires at least: 4.5 -Tested up to: 5.1.1 +Tested up to: 5.4.1 Requires PHP: 5.6 -Stable tag: 1.2.1 +Stable tag: 1.2.2 License: GPL version 2 License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -31,10 +31,15 @@ Please visit our [extension library](https://theeventscalendar.com/extensions/) = What if I experience problems? = -We're always interested in your feedback and our [premium forums](https://theeventscalendar.com/support-forums/) are the best place to flag any issues. Do note, however, that the degree of support we provide for extensions like this one tends to be very limited. +We're always interested in your feedback, and our [premium forums](https://theeventscalendar.com/support-forums/) are the best place to flag any issues. Do note, however, that the degree of support we provide for extensions like this one tends to be very limited. == Changelog == += [1.2.2] 2020-06-10 = + +* Fix - Update mPDF library version so this plugin now works with PHP 7.4. [EXT-211] +* Tweak - "WooCommerce tested up to" version changed from `3.7.0` to `4.2.0`. [EXT-211] + = [1.2.1] 2019-09-05 = * Tweak - Now requires Event Tickets Plus version 4.7 or newer diff --git a/tribe-ext-pdf-tickets.php b/tribe-ext-pdf-tickets.php index fa675bc..e69452f 100644 --- a/tribe-ext-pdf-tickets.php +++ b/tribe-ext-pdf-tickets.php @@ -2,7 +2,7 @@ /** * Plugin Name: Event Tickets Extension: PDF Tickets * Description: Event Tickets' RSVP, Tribe Commerce PayPal, WooCommerce, and/or Easy Digital Downloads ticket emails will become PDF files saved to your Uploads directory and then get attached to the ticket emails. - * Version: 1.2.1 + * Version: 1.2.2 * Extension Class: Tribe__Extension__PDF_Tickets * Plugin URI: https://theeventscalendar.com/extensions/pdf-tickets/ * GitHub Plugin URI: https://github.com/mt-support/tribe-ext-pdf-tickets @@ -11,7 +11,7 @@ * License: GPL version 2 * License URI: https://www.gnu.org/licenses/gpl-2.0.html * Text Domain: tribe-ext-pdf-tickets - * WC tested up to: 3.7.0 + * WC tested up to: 4.2.0 */ use Mpdf\Mpdf;