Skip to content
Snippets Groups Projects
Commit 99c8d61f authored by Ere Maijala's avatar Ere Maijala Committed by Demian Katz
Browse files

Use realpath when concatenating files. (#1296)

- Fixes problems related to symlinks.
parent 41ed5e6b
Branches
Tags
No related merge requests found
......@@ -230,7 +230,10 @@ trait ConcatTrait
}
// Locate/create concatenated asset file
$filename = md5($group['key']) . '.min.' . $this->getFileType();
$concatPath = $this->getResourceCacheDir() . $filename;
// Minifier uses realpath, so do that here too to make sure we're not
// pointing to a symlink. Otherwise the path converter won't find the correct
// shared directory part.
$concatPath = realpath($this->getResourceCacheDir()) . '/' . $filename;
if (!file_exists($concatPath)) {
$lockfile = "$concatPath.lock";
$handle = fopen($lockfile, 'c+');
......@@ -276,6 +279,7 @@ trait ConcatTrait
. $this->getResourceFilePath($item),
ThemeInfo::RETURN_ALL_DETAILS
);
$details['path'] = realpath($details['path']);
$data[] = $this->getMinifiedData($details, $concatPath);
}
// Separate each file's data with a new line so that e.g. a file
......
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