Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dbc4148

Browse files
committed
[Filesystem] Check that the directory is writable after created it in dumpFile()
1 parent 182dd8f commit dbc4148

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Symfony/Component/Filesystem/Filesystem.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,9 @@ public function dumpFile($filename, $content, $mode = 0666)
498498

499499
if (!is_dir($dir)) {
500500
$this->mkdir($dir);
501-
} elseif (!is_writable($dir)) {
501+
}
502+
503+
if (!is_writable($dir)) {
502504
throw new IOException(sprintf('Unable to write to the "%s" directory.', $dir), 0, null, $dir);
503505
}
504506

0 commit comments

Comments
 (0)