[BUGFIX] Don't use folders as templates, partials and layouts
authorMarc Bastian Heinrichs <typo3@mbh-software.de>
Sat, 13 Apr 2013 17:11:49 +0000 (19:11 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Sun, 14 Apr 2013 11:00:25 +0000 (13:00 +0200)
The file_exists checks in TemplateView and StandaloneView are true for
folders. This leads to unrendered partials with resorted paths.
Use is_file.

Releases: 6.1, 6.0, 4.7, 1.3
Fixes: #47186
Fluid Package Issue: #47188

Change-Id: Ib64e180e01d66777bb5b0683cce26d88ec2a9fd6
Reviewed-on: https://review.typo3.org/19920
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/fluid/Classes/View/StandaloneView.php
typo3/sysext/fluid/Classes/View/TemplateView.php

index dad9c16..716de3b 100644 (file)
@@ -320,7 +320,7 @@ class StandaloneView extends \TYPO3\CMS\Fluid\View\AbstractTemplateView {
                $possibleLayoutPaths[] = \TYPO3\CMS\Core\Utility\GeneralUtility::fixWindowsFilePath($layoutRootPath . '/' . $layoutName . '.' . $this->getRequest()->getFormat());
                $possibleLayoutPaths[] = \TYPO3\CMS\Core\Utility\GeneralUtility::fixWindowsFilePath($layoutRootPath . '/' . $layoutName);
                foreach ($possibleLayoutPaths as $layoutPathAndFilename) {
-                       if (file_exists($layoutPathAndFilename)) {
+                       if (is_file($layoutPathAndFilename)) {
                                return $layoutPathAndFilename;
                        }
                }
@@ -373,7 +373,7 @@ class StandaloneView extends \TYPO3\CMS\Fluid\View\AbstractTemplateView {
                $possiblePartialPaths[] = \TYPO3\CMS\Core\Utility\GeneralUtility::fixWindowsFilePath($partialRootPath . '/' . $partialName . '.' . $this->getRequest()->getFormat());
                $possiblePartialPaths[] = \TYPO3\CMS\Core\Utility\GeneralUtility::fixWindowsFilePath($partialRootPath . '/' . $partialName);
                foreach ($possiblePartialPaths as $partialPathAndFilename) {
-                       if (file_exists($partialPathAndFilename)) {
+                       if (is_file($partialPathAndFilename)) {
                                return $partialPathAndFilename;
                        }
                }
index 20b9135..33e5c30 100644 (file)
@@ -210,7 +210,7 @@ class TemplateView extends \TYPO3\CMS\Fluid\View\AbstractTemplateView {
                $paths = $this->expandGenericPathPattern($this->templatePathAndFilenamePattern, FALSE, FALSE);
                foreach ($paths as &$templatePathAndFilename) {
                        $templatePathAndFilename = str_replace('@action', $actionName, $templatePathAndFilename);
-                       if (file_exists($templatePathAndFilename)) {
+                       if (is_file($templatePathAndFilename)) {
                                return $templatePathAndFilename;
                        }
                }
@@ -271,7 +271,7 @@ class TemplateView extends \TYPO3\CMS\Fluid\View\AbstractTemplateView {
                $layoutName = ucfirst($layoutName);
                foreach ($paths as &$layoutPathAndFilename) {
                        $layoutPathAndFilename = str_replace('@layout', $layoutName, $layoutPathAndFilename);
-                       if (file_exists($layoutPathAndFilename)) {
+                       if (is_file($layoutPathAndFilename)) {
                                return $layoutPathAndFilename;
                        }
                }
@@ -318,7 +318,7 @@ class TemplateView extends \TYPO3\CMS\Fluid\View\AbstractTemplateView {
                $paths = $this->expandGenericPathPattern($this->partialPathAndFilenamePattern, TRUE, TRUE);
                foreach ($paths as &$partialPathAndFilename) {
                        $partialPathAndFilename = str_replace('@partial', $partialName, $partialPathAndFilename);
-                       if (file_exists($partialPathAndFilename)) {
+                       if (is_file($partialPathAndFilename)) {
                                return $partialPathAndFilename;
                        }
                }