Skip to content

Commit

Permalink
[BUGFIX] Avoid exception on trailing comma in include_static_file.txt
Browse files Browse the repository at this point in the history
If an entry in the include_static_file.txt file contains a trailing
comma, a RuntimeException (1651137904) is thrown. The problem is a
check whether the path contains 'EXT:', in this case the second path
is an empty string and hence the exception is thrown.

The change removes empty strings when splitting the entries in the
file by comma.

Resolves: #102659
Releases: main, 12.4
Change-Id: Ic2290b0b153487c7e982b4bca6b220a6bb9abf55
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82121
Tested-by: Benni Mack <benni@typo3.org>
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Benni Mack <benni@typo3.org>
  • Loading branch information
thomashohn authored and bmack committed Dec 12, 2023
1 parent 731e9ac commit a26f2db
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -328,7 +328,7 @@ private function handleSingleIncludeStaticFile(IncludeInterface $parentNode, $in
$parentNode->addChild($includeStaticFileFileInclude);
$includeStaticFileFileIncludeContent = (string)file_get_contents($includeStaticFileFileIncludePath);
// @todo: There is no array_unique() for DB based include_static_file content?!
$includeStaticFileFileIncludeArray = array_unique(GeneralUtility::trimExplode(',', $includeStaticFileFileIncludeContent));
$includeStaticFileFileIncludeArray = array_unique(GeneralUtility::trimExplode(',', $includeStaticFileFileIncludeContent, true));
foreach ($includeStaticFileFileIncludeArray as $includeStaticFileFileIncludeString) {
$this->handleSingleIncludeStaticFile($includeStaticFileFileInclude, $includeStaticFileFileIncludeString);
}
Expand Down

0 comments on commit a26f2db

Please sign in to comment.