diff --git a/typo3/sysext/core/Classes/Resource/Driver/DriverRegistry.php b/typo3/sysext/core/Classes/Resource/Driver/DriverRegistry.php index 6cb7f0308625b5d9e2d717dc6833a9e2adac7751..f506b17a54bfcedcfc86afcfae87c91b55e84ba0 100644 --- a/typo3/sysext/core/Classes/Resource/Driver/DriverRegistry.php +++ b/typo3/sysext/core/Classes/Resource/Driver/DriverRegistry.php @@ -48,7 +48,7 @@ class DriverRegistry implements SingletonInterface * Registers a driver class with an optional short name. * * @param string $className - * @param string $shortName + * @param string|null $shortName * @param string $label * @param string $flexFormDataStructurePathAndFilename * @return bool TRUE if registering succeeded @@ -56,6 +56,9 @@ class DriverRegistry implements SingletonInterface */ public function registerDriverClass($className, $shortName = null, $label = null, $flexFormDataStructurePathAndFilename = null) { + // todo: Default of $shortName must be empty string, not null. + $shortName = (string)$shortName; + // check if the class is available for TYPO3 before registering the driver if (!class_exists($className)) { throw new \InvalidArgumentException('Class ' . $className . ' does not exist.', 1314979197); diff --git a/typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php b/typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php index afb2ee6c9f335190e5bdd38fd89b8b27278c83cd..3137dd7c42e3da0f9da8bd2c36b27ccc8981a2c6 100644 --- a/typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php +++ b/typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php @@ -319,11 +319,11 @@ class LocalDriver extends AbstractHierarchicalFilesystemDriver implements Stream // Handle UTF-8 characters if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem']) { // Allow ".", "-", 0-9, a-z, A-Z and everything beyond U+C0 (latin capital letter a with grave) - $cleanFileName = preg_replace('/[' . self::UNSAFE_FILENAME_CHARACTER_EXPRESSION . ']/u', '_', trim($fileName)); + $cleanFileName = (string)preg_replace('/[' . self::UNSAFE_FILENAME_CHARACTER_EXPRESSION . ']/u', '_', trim($fileName)); } else { $fileName = GeneralUtility::makeInstance(CharsetConverter::class)->specCharsToASCII($charset, $fileName); // Replace unwanted characters with underscores - $cleanFileName = preg_replace('/[' . self::UNSAFE_FILENAME_CHARACTER_EXPRESSION . '\\xC0-\\xFF]/', '_', trim($fileName)); + $cleanFileName = (string)preg_replace('/[' . self::UNSAFE_FILENAME_CHARACTER_EXPRESSION . '\\xC0-\\xFF]/', '_', trim($fileName)); } // Strip trailing dots and return $cleanFileName = rtrim($cleanFileName, '.'); @@ -953,7 +953,7 @@ class LocalDriver extends AbstractHierarchicalFilesystemDriver implements Stream $sourcePath = $this->getAbsolutePath($fileIdentifier); $temporaryPath = $this->getTemporaryPathForFile($fileIdentifier); $result = copy($sourcePath, $temporaryPath); - touch($temporaryPath, filemtime($sourcePath)); + touch($temporaryPath, (int)filemtime($sourcePath)); if ($result === false) { throw new \RuntimeException( 'Copying file "' . $fileIdentifier . '" to temporary path "' . $temporaryPath . '" failed.', @@ -975,7 +975,7 @@ class LocalDriver extends AbstractHierarchicalFilesystemDriver implements Stream { $destinationFile = $recycleDirectory . '/' . PathUtility::basename($filePath); if (file_exists($destinationFile)) { - $timeStamp = \DateTimeImmutable::createFromFormat('U.u', microtime(true))->format('YmdHisu'); + $timeStamp = \DateTimeImmutable::createFromFormat('U.u', (string)microtime(true))->format('YmdHisu'); $destinationFile = $recycleDirectory . '/' . $timeStamp . '_' . PathUtility::basename($filePath); } $result = rename($filePath, $destinationFile); @@ -1234,6 +1234,9 @@ class LocalDriver extends AbstractHierarchicalFilesystemDriver implements Stream { $path = $this->getAbsolutePath($folderIdentifier); $dirHandle = opendir($path); + if ($dirHandle === false) { + return false; + } while ($entry = readdir($dirHandle)) { if ($entry !== '.' && $entry !== '..') { closedir($dirHandle); @@ -1390,7 +1393,7 @@ class LocalDriver extends AbstractHierarchicalFilesystemDriver implements Stream */ public function dumpFileContents($identifier) { - readfile($this->getAbsolutePath($this->canonicalizeAndCheckFileIdentifier($identifier)), 0); + readfile($this->getAbsolutePath($this->canonicalizeAndCheckFileIdentifier($identifier)), false); } /** diff --git a/typo3/sysext/core/Classes/Resource/Folder.php b/typo3/sysext/core/Classes/Resource/Folder.php index 794c5d5b358fe3671e7dba35acdbfb599a960eea..f1bc96c4c2f526dc10294a79dfc2a95d4eb8ce11 100644 --- a/typo3/sysext/core/Classes/Resource/Folder.php +++ b/typo3/sysext/core/Classes/Resource/Folder.php @@ -521,7 +521,7 @@ class Folder implements FolderInterface /** * Returns the role of this folder (if any). See FolderInterface::ROLE_* constants for possible values. * - * @return int + * @return string */ public function getRole() { diff --git a/typo3/sysext/core/Classes/Resource/Index/FileIndexRepository.php b/typo3/sysext/core/Classes/Resource/Index/FileIndexRepository.php index afe14c8dcd03241703342de69973b8dfa5202fe1..e910e170204a7124f714347ac4c460c7e271e692 100644 --- a/typo3/sysext/core/Classes/Resource/Index/FileIndexRepository.php +++ b/typo3/sysext/core/Classes/Resource/Index/FileIndexRepository.php @@ -79,7 +79,7 @@ class FileIndexRepository implements SingletonInterface * Retrieves Index record for a given $fileUid * * @param int $fileUid - * @return array|bool + * @return array|false */ public function findOneByUid($fileUid) { @@ -103,7 +103,7 @@ class FileIndexRepository implements SingletonInterface * * @param int $storageUid * @param string $identifierHash - * @return array|bool + * @return array|false * * @internal only for use from FileRepository */ diff --git a/typo3/sysext/core/Classes/Resource/Rendering/AudioTagRenderer.php b/typo3/sysext/core/Classes/Resource/Rendering/AudioTagRenderer.php index e252078983905d079d3090a7865333c22cc3b474..25a8de2b04c0ee3772444715e15596098fea2ba0 100644 --- a/typo3/sysext/core/Classes/Resource/Rendering/AudioTagRenderer.php +++ b/typo3/sysext/core/Classes/Resource/Rendering/AudioTagRenderer.php @@ -108,7 +108,7 @@ class AudioTagRenderer implements FileRendererInterface return sprintf( '<audio%s><source src="%s" type="%s"></audio>', empty($additionalAttributes) ? '' : ' ' . implode(' ', $additionalAttributes), - htmlspecialchars($file->getPublicUrl($usedPathsRelativeToCurrentScript)), + htmlspecialchars((string)$file->getPublicUrl($usedPathsRelativeToCurrentScript)), $file->getMimeType() ); } diff --git a/typo3/sysext/core/Classes/Resource/Rendering/VideoTagRenderer.php b/typo3/sysext/core/Classes/Resource/Rendering/VideoTagRenderer.php index b587be2696202010615434da8c022ccbc1282387..0fb27d1e0a0610ea678eddee0df663003c9589e2 100644 --- a/typo3/sysext/core/Classes/Resource/Rendering/VideoTagRenderer.php +++ b/typo3/sysext/core/Classes/Resource/Rendering/VideoTagRenderer.php @@ -125,7 +125,7 @@ class VideoTagRenderer implements FileRendererInterface return sprintf( '<video%s><source src="%s" type="%s"></video>', empty($attributes) ? '' : ' ' . implode(' ', $attributes), - htmlspecialchars($file->getPublicUrl($usedPathsRelativeToCurrentScript)), + htmlspecialchars((string)$file->getPublicUrl($usedPathsRelativeToCurrentScript)), $file->getMimeType() ); } diff --git a/typo3/sysext/core/Classes/Resource/ResourceCompressor.php b/typo3/sysext/core/Classes/Resource/ResourceCompressor.php index c5e8201d638d845e37603bcebf8726b9451591de..2a7347e62eef85576ff197d78bbd4d722b799bc5 100644 --- a/typo3/sysext/core/Classes/Resource/ResourceCompressor.php +++ b/typo3/sysext/core/Classes/Resource/ResourceCompressor.php @@ -281,7 +281,7 @@ class ResourceCompressor foreach ($filesToInclude as $filename) { $filenameAbsolute = GeneralUtility::resolveBackPath($this->rootPath . $filename); $filename = PathUtility::stripPathSitePrefix($filenameAbsolute); - $contents = file_get_contents($filenameAbsolute); + $contents = (string)file_get_contents($filenameAbsolute); // remove any UTF-8 byte order mark (BOM) from files if (strpos($contents, "\xEF\xBB\xBF") === 0) { $contents = substr($contents, 3); @@ -353,7 +353,7 @@ class ResourceCompressor $targetFile = $this->targetDirectory . $pathinfo['filename'] . '-' . md5($unique) . '.css'; // only create it, if it doesn't exist, yet if (!file_exists(Environment::getPublicPath() . '/' . $targetFile) || $this->createGzipped && !file_exists(Environment::getPublicPath() . '/' . $targetFile . '.gzip')) { - $contents = $this->compressCssString(file_get_contents($filenameAbsolute)); + $contents = $this->compressCssString((string)file_get_contents($filenameAbsolute)); if (strpos($filename, $this->targetDirectory) === false) { $contents = $this->cssFixRelativeUrlPaths($contents, $filename); } @@ -405,7 +405,7 @@ class ResourceCompressor $targetFile = $this->targetDirectory . $pathinfo['filename'] . '-' . md5($unique) . '.js'; // only create it, if it doesn't exist, yet if (!file_exists(Environment::getPublicPath() . '/' . $targetFile) || $this->createGzipped && !file_exists(Environment::getPublicPath() . '/' . $targetFile . '.gzip')) { - $contents = file_get_contents($filenameAbsolute); + $contents = (string)file_get_contents($filenameAbsolute); $this->writeFileAndCompressed($targetFile, $contents); } return $this->returnFileReference($targetFile); @@ -455,7 +455,7 @@ class ResourceCompressor return $fileNameWithoutSlash; } // if the file is from a special TYPO3 internal directory, add the missing typo3/ prefix - if (is_file(realpath(Environment::getBackendPath() . '/' . $filename))) { + if (is_file((string)realpath(Environment::getBackendPath() . '/' . $filename))) { $filename = 'typo3/' . $filename; } // build the file path relative to the public web path @@ -469,7 +469,7 @@ class ResourceCompressor // check if the file exists, and if so, return the path relative to current PHP script if (is_file($file)) { - return rtrim(PathUtility::getRelativePathTo($file), '/'); + return rtrim((string)PathUtility::getRelativePathTo($file), '/'); } // none of above conditions were met, fallback to default behaviour return $filename; @@ -569,7 +569,7 @@ class ResourceCompressor GeneralUtility::writeFile(Environment::getPublicPath() . '/' . $filename, $contents); if ($this->createGzipped) { // create compressed version - GeneralUtility::writeFile(Environment::getPublicPath() . '/' . $filename . '.gzip', gzencode($contents, $this->gzipCompressionLevel)); + GeneralUtility::writeFile(Environment::getPublicPath() . '/' . $filename . '.gzip', (string)gzencode($contents, $this->gzipCompressionLevel)); } } @@ -601,7 +601,7 @@ class ResourceCompressor $filename = $this->targetDirectory . 'external-' . md5($url); // Write only if file does not exist OR md5 of the content is not the same as fetched one if (!file_exists(Environment::getPublicPath() . '/' . $filename) - || !hash_equals(md5(file_get_contents(Environment::getPublicPath() . '/' . $filename)), md5($externalContent)) + || !hash_equals(md5((string)file_get_contents(Environment::getPublicPath() . '/' . $filename)), md5($externalContent)) ) { GeneralUtility::writeFile(Environment::getPublicPath() . '/' . $filename, $externalContent); } @@ -624,7 +624,7 @@ class ResourceCompressor // Regexp to match single quoted strings. $single_quot = "'[^'\\\\]*(?:\\\\.[^'\\\\]*)*'"; // Strip all comment blocks, but keep double/single quoted strings. - $contents = preg_replace( + $contents = (string)preg_replace( "<($double_quot|$single_quot)|$comment>Ss", '$1', $contents @@ -633,7 +633,7 @@ class ResourceCompressor // There are different conditions for removing leading and trailing // whitespace. // @see https://php.net/manual/regexp.reference.subpatterns.php - $contents = preg_replace( + $contents = (string)preg_replace( '< # Strip leading and trailing whitespace. \s*([@{};,])\s* diff --git a/typo3/sysext/core/Classes/Resource/ResourceFactory.php b/typo3/sysext/core/Classes/Resource/ResourceFactory.php index 9e8b325a3fcf63b916263842ecfd75952b1564cd..fa4483b8f74d8c2358e7770a00d0c3f1a2c06f65 100644 --- a/typo3/sysext/core/Classes/Resource/ResourceFactory.php +++ b/typo3/sysext/core/Classes/Resource/ResourceFactory.php @@ -80,7 +80,7 @@ class ResourceFactory implements SingletonInterface * Creates an instance of the storage from given UID. The $recordData can * be supplied to increase performance. * - * @param int $uid The uid of the storage to instantiate. + * @param int|null $uid The uid of the storage to instantiate. * @param array $recordData The record row from database. * @param string $fileIdentifier Identifier for a file. Used for auto-detection of a storage, but only if $uid === 0 (Local default storage) is used * @@ -239,7 +239,7 @@ class ResourceFactory implements SingletonInterface } $parts = GeneralUtility::trimExplode(':', $identifier); if (count($parts) === 2) { - $storageUid = $parts[0]; + $storageUid = (int)$parts[0]; $fileIdentifier = $parts[1]; } else { // We only got a path: Go into backwards compatibility mode and @@ -300,7 +300,7 @@ class ResourceFactory implements SingletonInterface return $this->retrieveFileOrFolderObject($input); } if (MathUtility::canBeInterpretedAsInteger($input)) { - return $this->getFileObject($input); + return $this->getFileObject((int)$input); } if (strpos($input, ':') > 0) { [$prefix] = explode(':', $input); @@ -341,7 +341,7 @@ class ResourceFactory implements SingletonInterface { $parts = GeneralUtility::trimExplode(':', $identifier); if (count($parts) === 2) { - $storageUid = $parts[0]; + $storageUid = (int)$parts[0]; $folderIdentifier = $parts[1]; } else { // We only got a path: Go into backwards compatibility mode and diff --git a/typo3/sysext/core/Classes/Resource/ResourceStorage.php b/typo3/sysext/core/Classes/Resource/ResourceStorage.php index d1667f59478627994289442de88ff5835471ad39..02c6d9f08308eed66a83a02aa42e6041d262ba23 100644 --- a/typo3/sysext/core/Classes/Resource/ResourceStorage.php +++ b/typo3/sysext/core/Classes/Resource/ResourceStorage.php @@ -2069,7 +2069,7 @@ class ResourceStorage implements ResourceStorageInterface } elseif ($conflictMode->equals(DuplicationBehavior::CANCEL)) { throw $exception; } elseif ($conflictMode->equals(DuplicationBehavior::REPLACE)) { - $sourceFileIdentifier = substr($file->getCombinedIdentifier(), 0, strrpos($file->getCombinedIdentifier(), '/') + 1) . $targetFileName; + $sourceFileIdentifier = substr($file->getCombinedIdentifier(), 0, (int)strrpos($file->getCombinedIdentifier(), '/') + 1) . $targetFileName; $sourceFile = $this->getResourceFactoryInstance()->getFileObjectFromCombinedIdentifier($sourceFileIdentifier); $file = $this->replaceFile($sourceFile, Environment::getPublicPath() . '/' . $file->getPublicUrl()); } @@ -2281,21 +2281,23 @@ class ResourceStorage implements ResourceStorageInterface } else { $this->copyFolderBetweenStorages($folderToCopy, $targetParentFolder, $sanitizedNewFolderName); } - $this->eventDispatcher->dispatch( - new AfterFolderCopiedEvent($folderToCopy, $targetParentFolder, $returnObject) - ); + if ($folderToCopy instanceof Folder && $targetParentFolder instanceof Folder) { + $this->eventDispatcher->dispatch( + new AfterFolderCopiedEvent($folderToCopy, $targetParentFolder, $returnObject) + ); + } return $returnObject; } /** * Copies a folder between storages. * - * @param Folder $folderToCopy - * @param Folder $targetParentFolder + * @param FolderInterface $folderToCopy + * @param FolderInterface $targetParentFolder * @param string $newFolderName * @throws NotImplementedMethodException */ - protected function copyFolderBetweenStorages(Folder $folderToCopy, Folder $targetParentFolder, $newFolderName) + protected function copyFolderBetweenStorages(FolderInterface $folderToCopy, FolderInterface $targetParentFolder, $newFolderName) { throw new NotImplementedMethodException('Not yet implemented.', 1476046386); } diff --git a/typo3/sysext/core/Classes/Resource/Search/FileSearchQuery.php b/typo3/sysext/core/Classes/Resource/Search/FileSearchQuery.php index 05ca85c889411dbe042f8eeb53b6487a1d562524..06c2cc26e13bf6444e5b52878a4207382423c278 100644 --- a/typo3/sysext/core/Classes/Resource/Search/FileSearchQuery.php +++ b/typo3/sysext/core/Classes/Resource/Search/FileSearchQuery.php @@ -72,9 +72,10 @@ class FileSearchQuery $query->additionalRestriction( new SearchTermRestriction($searchDemand, $query->queryBuilder) ); - if ($searchDemand->getFolder()) { + $folder = $searchDemand->getFolder(); + if ($folder !== null) { $query->additionalRestriction( - new FolderRestriction($searchDemand->getFolder(), $searchDemand->isRecursive()) + new FolderRestriction($folder, $searchDemand->isRecursive()) ); } else { $query->additionalRestriction( @@ -141,9 +142,10 @@ class FileSearchQuery $query->additionalRestriction( new SearchTermRestriction($searchDemand, $query->queryBuilder) ); - if ($searchDemand->getFolder()) { + $folder = $searchDemand->getFolder(); + if ($folder !== null) { $query->additionalRestriction( - new FolderRestriction($searchDemand->getFolder(), $searchDemand->isRecursive()) + new FolderRestriction($folder, $searchDemand->isRecursive()) ); } diff --git a/typo3/sysext/core/Classes/Resource/Search/QueryRestrictions/SearchTermRestriction.php b/typo3/sysext/core/Classes/Resource/Search/QueryRestrictions/SearchTermRestriction.php index 35fa02984650b7032e2cd47d8eeb34eec42d3b46..f642334044b7a8a97819cdd2f7834eb8a7ccc8bb 100644 --- a/typo3/sysext/core/Classes/Resource/Search/QueryRestrictions/SearchTermRestriction.php +++ b/typo3/sysext/core/Classes/Resource/Search/QueryRestrictions/SearchTermRestriction.php @@ -68,7 +68,7 @@ class SearchTermRestriction implements QueryRestrictionInterface private function makeQuerySearchByTable(string $tableName, string $tableAlias): CompositeExpression { $fieldsToSearchWithin = $this->extractSearchableFieldsFromTable($tableName); - $searchTerm = $this->searchDemand->getSearchTerm(); + $searchTerm = (string)$this->searchDemand->getSearchTerm(); $constraints = []; $searchTermParts = str_getcsv($searchTerm, ' '); diff --git a/typo3/sysext/core/Classes/Resource/Search/Result/FileSearchResult.php b/typo3/sysext/core/Classes/Resource/Search/Result/FileSearchResult.php index e85efd5719ac0b5fe3e567534a39ce866246b265..b53f93d829dc1cdbf416efb4d7d7b80c8161ac42 100644 --- a/typo3/sysext/core/Classes/Resource/Search/Result/FileSearchResult.php +++ b/typo3/sysext/core/Classes/Resource/Search/Result/FileSearchResult.php @@ -30,7 +30,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; class FileSearchResult implements FileSearchResultInterface { /** - * @var FileSearchQuery + * @var FileSearchDemand */ private $searchDemand; diff --git a/typo3/sysext/core/Classes/Resource/Security/FileMetadataPermissionsAspect.php b/typo3/sysext/core/Classes/Resource/Security/FileMetadataPermissionsAspect.php index 5a96ee111fc026c6ea7cae69f016f3339bcd5e08..2e80e3c2b6c5800982f48a0bfb613805b6a8e733 100644 --- a/typo3/sysext/core/Classes/Resource/Security/FileMetadataPermissionsAspect.php +++ b/typo3/sysext/core/Classes/Resource/Security/FileMetadataPermissionsAspect.php @@ -78,7 +78,7 @@ class FileMetadataPermissionsAspect implements DataHandlerCheckModifyAccessListH ); } - $fileMetadataRecord = BackendUtility::getRecord('sys_file_metadata', $id); + $fileMetadataRecord = (array)BackendUtility::getRecord('sys_file_metadata', (int)$id); $accessAllowed = $this->checkFileWriteAccessForFileMetaData($fileMetadataRecord); if (!$accessAllowed) { // If for any item in the array, access is not allowed, we deny the whole operation @@ -91,7 +91,7 @@ class FileMetadataPermissionsAspect implements DataHandlerCheckModifyAccessListH foreach ($parent->datamap[$table] as $id => $data) { $recordAccessAllowed = false; - if (strpos($id, 'NEW') === false) { + if (strpos((string)$id, 'NEW') === false) { $fileMetadataRecord = BackendUtility::getRecord('sys_file_metadata', $id); if ($fileMetadataRecord !== null) { if ($parent->isImporting && empty($fileMetadataRecord['file'])) { @@ -143,7 +143,7 @@ class FileMetadataPermissionsAspect implements DataHandlerCheckModifyAccessListH $accessAllowed = $parameters['hasAccess']; if ($accessAllowed && $table === 'sys_file_metadata' && $cmd === 'edit') { - $fileMetadataRecord = BackendUtility::getRecord('sys_file_metadata', $uid); + $fileMetadataRecord = (array)BackendUtility::getRecord('sys_file_metadata', $uid); $accessAllowed = $this->checkFileWriteAccessForFileMetaData($fileMetadataRecord); } return $accessAllowed; diff --git a/typo3/sysext/core/Classes/Resource/Service/UserFileInlineLabelService.php b/typo3/sysext/core/Classes/Resource/Service/UserFileInlineLabelService.php index aeffca3204ebda13f24425e52b14a445edd413df..1fae2062549492f633d8b6cd5887371ec622d833 100644 --- a/typo3/sysext/core/Classes/Resource/Service/UserFileInlineLabelService.php +++ b/typo3/sysext/core/Classes/Resource/Service/UserFileInlineLabelService.php @@ -78,7 +78,7 @@ class UserFileInlineLabelService if ((string)$value === '') { continue; } - $labelText = LocalizationUtility::translate('LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file.' . $field, 'lang'); + $labelText = (string)LocalizationUtility::translate('LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file.' . $field, 'lang'); $title[] = '<dt>' . htmlspecialchars($labelText) . '</dt><dd>' . $value . '</dd>'; } $params['title'] = '<dl>' . implode('', $title) . '</dl>'; diff --git a/typo3/sysext/core/Classes/Resource/StorageRepository.php b/typo3/sysext/core/Classes/Resource/StorageRepository.php index aa20cabc26b4e57a52140b51ee09ea65fac7d571..c1b45f81e781b9b0b01ddfaf42b3e0372da69553 100644 --- a/typo3/sysext/core/Classes/Resource/StorageRepository.php +++ b/typo3/sysext/core/Classes/Resource/StorageRepository.php @@ -200,7 +200,7 @@ class StorageRepository implements LoggerAwareInterface $storageObjects[] = $this->getStorageObject($storageRow['uid'], $storageRow); } else { $this->logger->warning( - sprintf('Could not instantiate storage "%s" because of missing driver.', [$storageRow['name']]), + sprintf('Could not instantiate storage "%s" because of missing driver.', $storageRow['name']), $storageRow ); } @@ -224,7 +224,7 @@ class StorageRepository implements LoggerAwareInterface $storageObjects[] = $this->getStorageObject($storageRow['uid'], $storageRow); } else { $this->logger->warning( - sprintf('Could not instantiate storage "%s" because of missing driver.', [$storageRow['name']]), + sprintf('Could not instantiate storage "%s" because of missing driver.', $storageRow['name']), $storageRow ); } @@ -437,7 +437,7 @@ class StorageRepository implements LoggerAwareInterface $storageConfiguration = $this->convertFlexFormDataToConfigurationArray($storageRecord['configuration']); } $driverType = $storageRecord['driver']; - $driverObject = $this->getDriverObject($driverType, $storageConfiguration); + $driverObject = $this->getDriverObject($driverType, (array)$storageConfiguration); $storageRecord['configuration'] = $storageConfiguration; return GeneralUtility::makeInstance(ResourceStorage::class, $driverObject, $storageRecord, $this->eventDispatcher); } diff --git a/typo3/sysext/core/Classes/Resource/TextExtraction/PlainTextExtractor.php b/typo3/sysext/core/Classes/Resource/TextExtraction/PlainTextExtractor.php index 3168cf17f7c4129be5471a2a4f35862bbf3a715e..f375fd2932904b0ddd5445bb7e6f785231c19889 100644 --- a/typo3/sysext/core/Classes/Resource/TextExtraction/PlainTextExtractor.php +++ b/typo3/sysext/core/Classes/Resource/TextExtraction/PlainTextExtractor.php @@ -51,7 +51,7 @@ class PlainTextExtractor implements TextExtractorInterface $localTempFile = $file->getForLocalProcessing(false); // extract text - $content = file_get_contents($localTempFile); + $content = (string)file_get_contents($localTempFile); // In case of remote storage, the temporary copy of the // original file in typo3temp must be removed