[BUGFIX] Do not try to resolve a path to t3lib 68/39968/2
authorMarkus Klein <markus.klein@typo3.org>
Wed, 3 Jun 2015 07:40:36 +0000 (09:40 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Fri, 5 Jun 2015 09:40:46 +0000 (11:40 +0200)
Resolves: #67267
Releases: master, 6.2
Change-Id: Ic866968a02a4e41df74ae56acd160d21177537d7
Reviewed-on: http://review.typo3.org/39968
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index b5fc243..e279dee 100644 (file)
@@ -18,7 +18,6 @@ use TYPO3\CMS\Core\Error\Http\PageNotFoundException;
 use TYPO3\CMS\Core\Resource\StorageRepository;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\HttpUtility;
-use TYPO3\CMS\Core\Utility\MathUtility;
 use TYPO3\CMS\Frontend\Page\PageRepository;
 
 /**
@@ -4618,16 +4617,16 @@ if (version == "n3") {
                } 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 (GeneralUtility::isFirstPartOfStr($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!';