[FOLLOWUP][TASK] Improve TCA cache 55/54155/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 21:05:51 +0000 (23:05 +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/54155
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Helmut Hummel <typo3@helhum.io>
Tested-by: Helmut Hummel <typo3@helhum.io>
typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php

index 94f7deb..b00e327 100644 (file)
@@ -1690,7 +1690,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();