Skip to content
Snippets Groups Projects
Commit 9d9d3940 authored by Wouter Wolters's avatar Wouter Wolters Committed by Susanne Moog
Browse files

Revert "[BUGFIX] ResourceCompressor must deal with absolute web paths"

This reverts commit 1d65ffe0.

Resolves: #78856
Related: #78803
Change-Id: I5ef82b6b5c32de798b6d2677bc9a6dd6089d386a
Reviewed-on: https://review.typo3.org/50843


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarGianluigi Martino <gmartino27@gmail.com>
Tested-by: default avatarGianluigi Martino <gmartino27@gmail.com>
Reviewed-by: default avatarAlexander Rothmund <alexander@rothmund.ch>
Tested-by: default avatarAlexander Rothmund <alexander@rothmund.ch>
Reviewed-by: default avatarSusanne Moog <susanne.moog@typo3.org>
Tested-by: default avatarSusanne Moog <susanne.moog@typo3.org>
parent f502f4e4
Branches
Tags
No related merge requests found
......@@ -419,16 +419,9 @@ class ResourceCompressor
*/
protected function getFilenameFromMainDir($filename)
{
$docRoot = GeneralUtility::getIndpEnv('TYPO3_DOCUMENT_ROOT');
$fileNameWithoutSlash = ltrim($filename, '/');
// if the file exists in the document root
if (is_file($docRoot . '/' . $fileNameWithoutSlash)) {
return substr($docRoot . '/' . $fileNameWithoutSlash, strlen($this->rootPath));
}
// if the file exists in the root path, just return the $filename
if (is_file($this->rootPath . $fileNameWithoutSlash)) {
return $fileNameWithoutSlash;
if (is_file($this->rootPath . ltrim($filename, '/'))) {
return ltrim($filename, '/');
}
// if the file is from a special TYPO3 internal directory, add the missing typo3/ prefix
if (is_file(realpath(PATH_site . TYPO3_mainDir . $filename))) {
......@@ -440,7 +433,7 @@ class ResourceCompressor
} elseif (strpos($filename, '../') === 0) {
$file = GeneralUtility::resolveBackPath(PATH_typo3 . $filename);
} else {
$file = PATH_site . $fileNameWithoutSlash;
$file = PATH_site . ltrim($filename, '/');
}
// check if the file exists, and if so, return the path relative to TYPO3_mainDir
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment