Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #10505 Rebuild and repair can lead to malformed grouped JS files #10507

Open
wants to merge 1 commit into
base: hotfix
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions jssource/minify_utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ function ConcatenateFiles($from_path)

//make sure we have handles to both source and target file
if ($trgt_handle) {
// Acquire exclusive lock on the target file.
flock($trgt_handle, LOCK_EX);

if ($already_minified || isset($excludedFiles[dirname((string) $loc)])) {
$buffer = file_get_contents($loc);
} else {
Expand All @@ -179,6 +182,8 @@ function ConcatenateFiles($from_path)
//log error, file did not get appended
echo "Error while concatenating file $loc to target file $trgt \n";
}
// Release the lock on the target file.
flock($trgt_handle, LOCK_UN);
//close file opened.
fclose($trgt_handle);
}
Expand Down