[BUGFIX] Do not try to resolve a path to t3lib 09/39909/2
authorMarkus Klein <markus.klein@typo3.org>
Wed, 3 Jun 2015 07:40:36 +0000 (09:40 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 5 Jun 2015 09:36:27 +0000 (11:36 +0200)
Resolves: #67267
Releases: master, 6.2
Change-Id: Ic866968a02a4e41df74ae56acd160d21177537d7
Reviewed-on: http://review.typo3.org/39909
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index 12934b0..cf0d6a5 100644 (file)
@@ -35,6 +35,7 @@ use TYPO3\CMS\Core\Locking\LockFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\HttpUtility;
 use TYPO3\CMS\Core\Utility\MathUtility;
+use TYPO3\CMS\Core\Utility\StringUtility;
 use TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication;
 use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
 use TYPO3\CMS\Frontend\Page\CacheHashCalculator;
@@ -4266,16 +4267,16 @@ class TypoScriptFrontendController {
                } else {
                        $trace = debug_backtrace();
                        // This is a hack to work around ___FILE___ resolving symbolic links
-                       $PATH_site_real = str_replace('t3lib', '', realpath(PATH_site . 't3lib'));
+                       $PATH_site_real = dirname(realpath(PATH_site . 'typo3')) . '/';
                        $file = $trace[0]['file'];
-                       if (substr($file, 0, strlen($PATH_site_real)) === $PATH_site_real) {
+                       if (StringUtility::beginsWith($file, $PATH_site_real)) {
                                $file = str_replace($PATH_site_real, '', $file);
                        } else {
                                $file = str_replace(PATH_site, '', $file);
                        }
                        $line = $trace[0]['line'];
                        $trigger = $file . ' on line ' . $line;
-                       $warning = '$TSFE->set_no_cache() was triggered by ' . $trigger . '.';
+                       $warning = '$GLOBALS[\'TSFE\']->set_no_cache() was triggered by ' . $trigger . '.';
                }
                if ($this->TYPO3_CONF_VARS['FE']['disableNoCacheParameter']) {
                        $warning .= ' However, $TYPO3_CONF_VARS[\'FE\'][\'disableNoCacheParameter\'] is set, so it will be ignored!';