Skip to content

Commit ddab627

Browse files
Merge branch '2.3' into 2.7
* 2.3: bug symfony#14246 [Filesystem] dumpFile() non atomic Conflicts: src/Symfony/Component/Filesystem/Filesystem.php
2 parents c457f7b + 3aa3000 commit ddab627

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Filesystem/Filesystem.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,14 +478,14 @@ public function dumpFile($filename, $content, $mode = 0666)
478478
throw new IOException(sprintf('Failed to write file "%s".', $filename), 0, null, $filename);
479479
}
480480

481-
$this->rename($tmpFile, $filename, true);
482481
if (null !== $mode) {
483482
if (func_num_args() > 2) {
484483
@trigger_error('Support for modifying file permissions is deprecated since version 2.3.12 and will be removed in 3.0.', E_USER_DEPRECATED);
485484
}
486485

487-
$this->chmod($filename, $mode);
486+
$this->chmod($tmpFile, $mode);
488487
}
488+
$this->rename($tmpFile, $filename, true);
489489
}
490490

491491
/**

0 commit comments

Comments
 (0)