You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Filesystem.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -54,12 +54,12 @@ public function copy($originFile, $targetFile, $overwriteNewerFiles = false)
54
54
55
55
if ($doCopy) {
56
56
// https://bugs.php.net/bug.php?id=64634
57
-
if (false === $source = @fopen($originFile, 'rb')) {
57
+
if (false === $source = @fopen($originFile, 'r')) {
58
58
thrownewIOException(sprintf('Failed to copy "%s" to "%s" because source file could not be opened for reading.', $originFile, $targetFile), 0, null, $originFile);
59
59
}
60
60
61
61
// Stream context created to allow files overwrite when using FTP stream wrapper - disabled by default
thrownewIOException(sprintf('Failed to copy "%s" to "%s" because target file could not be opened for writing.', $originFile, $targetFile), 0, null, $originFile);
64
64
}
65
65
@@ -647,7 +647,7 @@ public function tempnam($dir, $prefix)
647
647
648
648
// Use fopen instead of file_exists as some streams do not support stat
649
649
// Use mode 'x+' to atomically check existence and create to avoid a TOCTOU vulnerability
0 commit comments