Skip to content

Commit

Permalink
bug #14246 [Filesystem] dumpFile() non atomic
Browse files Browse the repository at this point in the history
  • Loading branch information
Hidde Boomsma committed Dec 31, 2015
1 parent 6b13708 commit e4015d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Symfony/Component/Filesystem/Filesystem.php
Expand Up @@ -477,9 +477,9 @@ public function dumpFile($filename, $content, $mode = 0666)
throw new IOException(sprintf('Failed to write file "%s".', $filename));
}

$this->rename($tmpFile, $filename, true);
if (null !== $mode) {
$this->chmod($filename, $mode);
$this->chmod($tmpFile, $mode);
}
$this->rename($tmpFile, $filename, true);
}
}

0 comments on commit e4015d5

Please sign in to comment.