[BUGFIX] Add proper URL check to TemplateService::getFileName() 49/33649/2
authorMarkus Klein <klein.t3@reelworx.at>
Thu, 30 Oct 2014 22:30:37 +0000 (23:30 +0100)
committerFrank Nägler <typo3@naegler.net>
Thu, 30 Oct 2014 22:44:05 +0000 (23:44 +0100)
This fixes the broken test introduced with #51781

Resolves: #62575
Releases: 6.2
Change-Id: I92541fbf2744399a1385ccc1bbbff2b2bd6709b2
Reviewed-on: http://review.typo3.org/33649
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Frank Nägler <typo3@naegler.net>
Tested-by: Frank Nägler <typo3@naegler.net>
typo3/sysext/core/Classes/TypoScript/TemplateService.php

index c67e759..41243e3 100644 (file)
@@ -1281,7 +1281,9 @@ class TemplateService {
                                $file = $newFile;
                        }
                }
-               if (parse_url($file) !== FALSE || is_file(PATH_site . $file)) {
+               // if this is an URL, it can be returned directly
+               $urlScheme = parse_url($file, PHP_URL_SCHEME);
+               if ($urlScheme === 'https' || $urlScheme === 'http' || is_file(PATH_site . $file)) {
                        return $file;
                }
                // Find