xperseguers / t3ext-extractor

TYPO3 Extension extractor
https://extensions.typo3.org/extension/extractor
GNU General Public License v2.0
15 stars 24 forks source link

Undefined array key in PdfInfoService #55

Closed chesio closed 1 year ago

chesio commented 2 years ago

If PDF file has some meta fields with no values (see example below), there is a warning generated in PHP 8 because the call to GeneralUtility::trimExplode on this line returns an array with one field only.

Example:

§ pdfinfo -enc UTF-8 TYPO3-v11-LTS-whats-new.pdf
Title:
Subject:
Keywords:

Fix is to set third parameter of GeneralUtility::trimExplode to false, so an array with two fields is always returned. If empty values should not be included in metadata, they can be filtered afterwards.