diff --git a/typo3/sysext/backend/Classes/Template/DocumentTemplate.php b/typo3/sysext/backend/Classes/Template/DocumentTemplate.php index dd9e90a538366183ca0c73bb5789c5aa47eb3615..9d05214a532838b0c8f4ee5a8ae1c23a0bca6c01 100644 --- a/typo3/sysext/backend/Classes/Template/DocumentTemplate.php +++ b/typo3/sysext/backend/Classes/Template/DocumentTemplate.php @@ -741,18 +741,8 @@ function jumpToUrl(URL) { if ($GLOBALS['TBE_STYLES']['htmlTemplates'][$filename]) { $filename = $GLOBALS['TBE_STYLES']['htmlTemplates'][$filename]; } - if (GeneralUtility::isFirstPartOfStr($filename, 'EXT:')) { - $filename = GeneralUtility::getFileAbsFileName($filename); - } elseif (!GeneralUtility::isAbsPath($filename)) { - $filename = GeneralUtility::resolveBackPath($filename); - } elseif (!GeneralUtility::isAllowedAbsPath($filename)) { - $filename = ''; - } - $htmlTemplate = ''; - if ($filename !== '') { - $htmlTemplate = file_get_contents($filename); - } - return $htmlTemplate; + $filename = GeneralUtility::getFileAbsFileName($filename); + return $filename !== '' ? file_get_contents($filename) : ''; } /** diff --git a/typo3/sysext/frontend/Classes/ContentObject/FluidTemplateContentObject.php b/typo3/sysext/frontend/Classes/ContentObject/FluidTemplateContentObject.php index dbc3d29f6e39465cff8981b79ce9e037cbe1e5ec..85cae47c41e92fe1b41ad3c8e8a326886de0fa0d 100644 --- a/typo3/sysext/frontend/Classes/ContentObject/FluidTemplateContentObject.php +++ b/typo3/sysext/frontend/Classes/ContentObject/FluidTemplateContentObject.php @@ -173,10 +173,9 @@ class FluidTemplateContentObject extends AbstractContentObject } else { // Fetch the Fluid template by file stdWrap $file = isset($conf['file.']) ? $this->cObj->stdWrap($conf['file'], $conf['file.']) : $conf['file']; - /** @var $templateService \TYPO3\CMS\Core\TypoScript\TemplateService */ - $templateService = $GLOBALS['TSFE']->tmpl; - $templatePathAndFilename = $templateService->getFileName($file); - $this->view->setTemplatePathAndFilename(PATH_site . $templatePathAndFilename); + // Get the absolute file name + $templatePathAndFilename = GeneralUtility::getFileAbsFileName($file); + $this->view->setTemplatePathAndFilename($templatePathAndFilename); } } diff --git a/typo3/sysext/frontend/Tests/Unit/ContentObject/FluidTemplateContentObjectTest.php b/typo3/sysext/frontend/Tests/Unit/ContentObject/FluidTemplateContentObjectTest.php index 54fe0a87fdc9d8f34e18dfc913a26a3d659d8faf..b4e4ac720b86f5a6e800342793bbad7bc8810259 100644 --- a/typo3/sysext/frontend/Tests/Unit/ContentObject/FluidTemplateContentObjectTest.php +++ b/typo3/sysext/frontend/Tests/Unit/ContentObject/FluidTemplateContentObjectTest.php @@ -181,18 +181,11 @@ class FluidTemplateContentObjectTest extends \TYPO3\TestingFramework\Core\Unit\U public function renderSetsTemplateFileInView() { $this->addMockViewToSubject(); - /** @var $templateService \PHPUnit_Framework_MockObject_MockObject */ - $templateService = $GLOBALS['TSFE']->tmpl; - $templateService - ->expects($this->any()) - ->method('getFileName') - ->with('foo') - ->will($this->returnValue('bar')); $this->standaloneView ->expects($this->any()) ->method('setTemplatePathAndFilename') - ->with(PATH_site . 'bar'); - $this->subject->render(['file' => 'foo']); + ->with(PATH_site . 'typo3/sysext/core/bar.html'); + $this->subject->render(['file' => 'EXT:core/bar.html']); } /**