[BUGFIX] Warning in getCompressedTCarray due to missing extTables.php 06/19706/4
authorPhilipp Gampe <philipp.gampe@typo3.org>
Sat, 6 Apr 2013 20:17:52 +0000 (22:17 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 6 Apr 2013 20:49:23 +0000 (22:49 +0200)
Since 6.0, constant TYPO3_extTableDef_script falls back to string
'extTables.php' if it is not defined otherwise. This might trigger
warnings for unclean code that used this constant before if the file
does not exist.

Fixes: #47002
Related: #44331
Related: #45122
Releases: 6.0
Change-Id: Id4e7f492f262735e965c70df0b770c62a6923773
Reviewed-on: https://review.typo3.org/19706
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index 4e3a02b..996551d 100644 (file)
@@ -2469,7 +2469,12 @@ class TypoScriptFrontendController {
                $GLOBALS['TT']->push('Get Compressed TC array');
                if (!$this->TCAloaded) {
                        // Create hash string for storage / retrieval of cached content:
-                       $tempHash = md5('tables.php:' . filemtime((TYPO3_extTableDef_script ? PATH_typo3conf . TYPO3_extTableDef_script : PATH_t3lib . 'stddb/tables.php')) . (TYPO3_extTableDef_script ? filemtime(PATH_typo3conf . TYPO3_extTableDef_script) : ''));
+                       $extTableDef = PATH_typo3conf . TYPO3_extTableDef_script;
+                       $tempHash = md5(
+                               'tables.php:'
+                               . (filemtime(is_file($extTableDef) ? $extTableDef : PATH_t3lib . 'stddb/tables.php'))
+                               . (is_file($extTableDef) ? filemtime($extTableDef) : '')
+                       );
                        list($GLOBALS['TCA'], $this->TCAcachedExtras) = unserialize($this->sys_page->getHash($tempHash));
                        // If no result, create it:
                        if (!is_array($GLOBALS['TCA'])) {