[BUGFIX] Compressor: filemtime(): stat failed in Help > About TYPO3
authorXavier Perseguers <xavier@typo3.org>
Fri, 31 Aug 2012 13:19:54 +0000 (15:19 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 1 Sep 2012 18:50:52 +0000 (20:50 +0200)
t3lib_Compressor fails to correctly compute relative path from
main directory when compressing JS and CSS files from Core that
do not contain the typo3/ prefix but start with either contrib/
or sysext/.

Change-Id: I41f09e76ea2ac48e1e9ce097de881334a324c357
Fixes: #35212
Releases: 6.0, 4.7, 4.6
Reviewed-on: http://review.typo3.org/14242
Reviewed-by: Laurent Cherpit
Tested-by: Laurent Cherpit
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/core/Classes/Resource/ResourceCompressor.php

index 1d0fe72..dd0ce68 100644 (file)
@@ -508,6 +508,10 @@ class ResourceCompressor {
                                return $file;
                        }
                }
+               // if the file is from a special TYPO3 internal directory, add the missing typo3/ prefix
+               if (is_file(PATH_site . TYPO3_mainDir . $filename)) {
+                       $filename = TYPO3_mainDir . $filename;
+               }
                // build the file path relatively to the PATH_site
                $backPath = str_replace(TYPO3_mainDir, '', $this->backPath);
                $file = str_replace($backPath, '', $filename);