[FOLLOWUP][TASK] Improve TCA cache 54/54154/2
authorOliver Hader <oliver@typo3.org>
Sun, 17 Sep 2017 18:19:57 +0000 (20:19 +0200)
committerHelmut Hummel <typo3@helhum.io>
Sun, 17 Sep 2017 20:33:34 +0000 (22:33 +0200)
Allowed classes in the options of unserialize invocation need to
be injected using the 'allowed_classes' array index - the current
implementation is casted to true which allows all classes.

Related: #82408
Releases: master, 8.7
Change-Id: I68fbd873a5a7057630a48586878c77547b532348
Reviewed-on: https://review.typo3.org/54154
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
Reviewed-by: Helmut Hummel <typo3@helhum.io>
Tested-by: Helmut Hummel <typo3@helhum.io>
typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php

index 1167904..9f98695 100644 (file)
@@ -1581,7 +1581,13 @@ tt_content.' . $key . $suffix . ' {
             $cacheData = $codeCache->requireOnce($cacheIdentifier);
             if ($cacheData) {
                 $GLOBALS['TCA'] = $cacheData['tca'];
-                GeneralUtility::setSingletonInstance(CategoryRegistry::class, unserialize($cacheData['categoryRegistry'], [CategoryRegistry::class]));
+                GeneralUtility::setSingletonInstance(
+                    CategoryRegistry::class,
+                    unserialize(
+                        $cacheData['categoryRegistry'],
+                        ['allowed_classes' => [CategoryRegistry::class]]
+                    )
+                );
             } else {
                 static::buildBaseTcaFromSingleFiles();
                 static::createBaseTcaCacheFile();