diff --git a/src/Illuminate/Filesystem/Filesystem.php b/src/Illuminate/Filesystem/Filesystem.php index b57d8cd08d62..c8f5f33c4c11 100644 --- a/src/Illuminate/Filesystem/Filesystem.php +++ b/src/Illuminate/Filesystem/Filesystem.php @@ -152,6 +152,8 @@ public function replace($path, $content) } $tempPath = tempnam($dirName, basename($path)); + // Remove tempPath because it will be created with incorrect permissions + unlink($tempPath); file_put_contents($tempPath, $content);