From bef63dfbaa28a0be82d7e116d3c396c27346e865 Mon Sep 17 00:00:00 2001 From: Bernhard Kraft <kraft@webconsulting.at> Date: Fri, 31 Jan 2014 09:56:50 +0100 Subject: [PATCH] [!!!][BUGFIX] Avoid unnecessary de-/serialization for page cache When storing a cache in page the array variable "cache_data" gets serialized and when being retrieved from cache unserialized. This is not necessary as de-/serialization is already performed by the variable caching backend. Change-Id: I9cf817123947af3f4076dabdce3c569bf41b477c Resolves: #55493 Releases: 6.2 Reviewed-on: https://review.typo3.org/27179 Reviewed-by: Anja Leichsenring Tested-by: Anja Leichsenring Reviewed-by: Andreas Wolf Tested-by: Andreas Wolf --- NEWS.md | 6 +++++- .../Classes/Controller/TypoScriptFrontendController.php | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index 4da0999b6f60..70b85b100ff7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -141,6 +141,10 @@ incomplete HTML when a frontend page is rendered was removed from the TYPO3 Core. Its functionality is now provided by the TER extension "Tidy". The extension works with the same options as before. +* Change in Hook TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageLoadedFromCache'] + +Previously $row['cache_data'] was a serialized array. To avoid double serializing and unserializing, +from now on $row['cache_data'] is just reconstituted as array when fetching from cache. ### Administration / Customization @@ -187,4 +191,4 @@ Pages and content elements are now categorizable by default. * New menu types The "Special Menus" content element type now offers the possibility to display -a list of categorized pages or content elements. +a list of categorized pages or content elements. \ No newline at end of file diff --git a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php index d8ca484c1271..18c1eb453b8d 100644 --- a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php +++ b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php @@ -2223,7 +2223,7 @@ class TypoScriptFrontendController { } } // Fetches the lowlevel config stored with the cached data - $this->config = (array) unserialize($row['cache_data']); + $this->config = $row['cache_data']; // Getting the content $this->content = $row['content']; // Flag for temp content @@ -3144,7 +3144,7 @@ class TypoScriptFrontendController { 'page_id' => $this->id, 'content' => $content, 'temp_content' => $this->tempContent, - 'cache_data' => serialize($data), + 'cache_data' => $data, 'expires' => $expirationTstamp, 'tstamp' => $GLOBALS['EXEC_TIME'] ); -- GitLab