[BUGFIX] Typo3DatabaseBackend get function does not return FALSE 45/19445/2
authorWouter Wolters <typo3@wouterwolters.nl>
Sat, 30 Mar 2013 12:56:44 +0000 (13:56 +0100)
committerJigal van Hemert <jigal@xs4all.nl>
Sat, 30 Mar 2013 13:05:43 +0000 (14:05 +0100)
Typo3DatabaseBackend get function does not return FALSE when
there is no result.

Change-Id: I738ffc2879a9c125af4e7f0727c2cb5c88ed2da0
Fixes: #46802
Releases: 6.1
Reviewed-on: https://review.typo3.org/19445
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
typo3/sysext/core/Classes/Cache/Backend/Typo3DatabaseBackend.php

index 3803677..935944b 100644 (file)
@@ -175,7 +175,7 @@ class Typo3DatabaseBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend
         */
        public function get($entryIdentifier) {
                $this->throwExceptionIfFrontendDoesNotExist();
-               $cacheEntry = FALSE;
+
                $cacheEntry = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('content', $this->cacheTable, 'identifier = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($entryIdentifier, $this->cacheTable) . ' AND ' . $this->notExpiredStatement);
                if (is_array($cacheEntry)) {
                        $cacheEntry = $cacheEntry['content'];
@@ -183,7 +183,7 @@ class Typo3DatabaseBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend
                if ($this->compression && strlen($cacheEntry)) {
                        $cacheEntry = gzuncompress($cacheEntry);
                }
-               return $cacheEntry;
+               return $cacheEntry !== NULL ? $cacheEntry : FALSE;
        }
 
        /**