Fixed bug #12794: t3lib_TStemplate::getFileName() handles path starting with media...
authorBenni Mack <benni.mack@typo3.org>
Sat, 27 Mar 2010 08:42:10 +0000 (08:42 +0000)
committerBenni Mack <benni.mack@typo3.org>
Sat, 27 Mar 2010 08:42:10 +0000 (08:42 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7202 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_tstemplate.php

index 71b46c8..ac36962 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2010-03-27  Benjamin Mack  <benni@typo3.org>
 
+       * Fixed bug #12794: t3lib_TStemplate::getFileName() handles path starting with media/ as magic
        * Fixed bug #13590: felogin adds field felogin_forgotHash to tca but does not add field to database (Thanks to Fabrizio Branca)
 
 2010-03-26  Oliver Hader  <oliver@typo3.org>
index 8356959..bfea913 100644 (file)
@@ -1210,9 +1210,13 @@ class t3lib_TStemplate   {
                }
 
                        // find
-               if (strstr($file,'/')) {        // here it is manual media
-                       if(!strcmp(substr($file,0,6),'media/')) $file = 'typo3/sysext/cms/tslib/'.$file;
-                       if (@is_file($this->getFileName_backPath.$file))        {
+               if (strpos($file, '/') !== false) {
+                               // if the file is in the media/ folder but it doesn't exist,
+                               // it is assumed that it's in the tslib folder
+                       if (t3lib_div::isFirstPartOfStr($file, 'media/') && !is_file($this->getFileName_backPath . $file)) {
+                               $file = t3lib_extMgm::siteRelPath('cms') . 'tslib/' . $file;
+                       }
+                       if (is_file($this->getFileName_backPath . $file)) {
                                $outFile = $file;
                                $fileInfo = t3lib_div::split_fileref($outFile);
                                $OK=0;