8000 dumpFile(), preserve existing file permissions by chs2 · Pull Request #21823 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

dumpFile(), preserve existing file permissions #21823

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

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
ternary op and positive condition
  • Loading branch information
chs2 authored and xabbuh committed Mar 6, 2017
commit 076a225bcc51a348b4f1e54a2a4c83911a07347d
6 changes: 1 addition & 5 deletions src/Symfony/Component/Filesystem/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -517,11 +517,7 @@ public function dumpFile($filename, $content, $mode = 0666)

$this->chmod($tmpFile, $mode);
} else {
if (file_exists($filename)) {
@chmod($tmpFile, fileperms($filename));
} else {
@chmod($tmpFile, 0666 & ~umask());
}
@chmod($tmpFile, file_exists($filename) ? fileperms($filename) : 0666 & ~umask());
}

$this->rename($tmpFile, $filename, true);
Expand Down
0