Commit 03f0b01c authored by Oliver Klee's avatar Oliver Klee Committed by Christian Kuhn
Browse files

[BUGFIX] Always call GU::trimExplode with string in extbase/fluid

This avoids problem when GU::trimExplode is switched to native type
declarations.

Also fix some possible invalid array accesses.

Resolves: #97960
Relates: #97602
Releases: main
Change-Id: I6a08b7a20f12475fbee7a5a817f1618e9466087c
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/75210

Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent af3f1885
......@@ -63,7 +63,7 @@ final class TypeConverterPass implements CompilerPassInterface
);
}
$sources = GeneralUtility::trimExplode(',', $attributes['sources'], true);
$sources = GeneralUtility::trimExplode(',', (string)$attributes['sources'], true);
if ($sources === []) {
throw new InvalidTypeConverterConfigurationException(
......
......@@ -173,7 +173,7 @@ class CacheService implements SingletonInterface
$pageTS = BackendUtility::getPagesTSconfig($storagePage);
if (isset($pageTS['TCEMAIN.']['clearCacheCmd'])) {
$clearCacheCommands = GeneralUtility::trimExplode(',', strtolower($pageTS['TCEMAIN.']['clearCacheCmd']), true);
$clearCacheCommands = GeneralUtility::trimExplode(',', strtolower((string)$pageTS['TCEMAIN.']['clearCacheCmd']), true);
$clearCacheCommands = array_unique($clearCacheCommands);
foreach ($clearCacheCommands as $clearCacheCommand) {
if (MathUtility::canBeInterpretedAsInteger($clearCacheCommand)) {
......
......@@ -61,14 +61,12 @@ class ExtensionUtility
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'][$extensionName]['plugins'][$pluginName]['controllers'][$controllerClassName] = [
'className' => $controllerClassName,
'alias' => $controllerAlias,
'actions' => GeneralUtility::trimExplode(',', $actionsList),
'actions' => GeneralUtility::trimExplode(',', (string)$actionsList),
];
if (isset($nonCacheableControllerActions[$controllerClassName]) && !empty($nonCacheableControllerActions[$controllerClassName])) {
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'][$extensionName]['plugins'][$pluginName]['controllers'][$controllerClassName]['nonCacheableActions'] = GeneralUtility::trimExplode(
',',
$nonCacheableControllerActions[$controllerClassName]
);
if (!empty($nonCacheableControllerActions[$controllerClassName])) {
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'][$extensionName]['plugins'][$pluginName]['controllers'][$controllerClassName]['nonCacheableActions']
= GeneralUtility::trimExplode(',', (string)$nonCacheableControllerActions[$controllerClassName]);
}
}
......
......@@ -121,7 +121,7 @@ final class CObjectViewHelper extends AbstractViewHelper
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext): string
{
$data = $renderChildrenClosure();
$typoscriptObjectPath = $arguments['typoscriptObjectPath'];
$typoscriptObjectPath = (string)$arguments['typoscriptObjectPath'];
$currentValueKey = $arguments['currentValueKey'];
$table = $arguments['table'];
$contentObjectRenderer = self::getContentObjectRenderer($renderingContext->getRequest());
......
......@@ -91,7 +91,7 @@ final class BytesViewHelper extends AbstractViewHelper
} else {
$units = LocalizationUtility::translate('viewhelper.format.bytes.units', 'fluid');
}
$units = GeneralUtility::trimExplode(',', $units, true);
$units = GeneralUtility::trimExplode(',', (string)$units, true);
$value = $renderChildrenClosure();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment