[BUGFIX] Compressor: filemtime(): stat failed in Help > About TYPO3
authorXavier Perseguers <xavier@typo3.org>
Sun, 25 Mar 2012 16:31:48 +0000 (18:31 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 1 Sep 2012 18:50:06 +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/9864
Reviewed-by: Dominique Feyer
Tested-by: Dominique Feyer
Reviewed-by: Laurent Cherpit
Tested-by: Laurent Cherpit
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
t3lib/class.t3lib_compressor.php

index cbb4b7f..efeffab 100644 (file)
@@ -491,6 +491,11 @@ class t3lib_Compressor {
                        }
                }
 
+                       // 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);