Skip to content

Commit fd7bd65

Browse files
author
vladimir.reznichenko
committed
SCA: reverted code style changes
1 parent 31fd91f commit fd7bd65

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Filesystem.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ public function copy($originFile, $targetFile, $overwriteNewerFiles = false)
5454

5555
if ($doCopy) {
5656
// https://bugs.php.net/bug.php?id=64634
57-
if (false === $source = @fopen($originFile, 'rb')) {
57+
if (false === $source = @fopen($originFile, 'r')) {
5858
throw new IOException(sprintf('Failed to copy "%s" to "%s" because source file could not be opened for reading.', $originFile, $targetFile), 0, null, $originFile);
5959
}
6060

6161
// Stream context created to allow files overwrite when using FTP stream wrapper - disabled by default
62-
if (false === $target = @fopen($targetFile, 'wb', null, stream_context_create(array('ftp' => array('overwrite' => true))))) {
62+
if (false === $target = @fopen($targetFile, 'w', null, stream_context_create(array('ftp' => array('overwrite' => true))))) {
6363
throw new IOException(sprintf('Failed to copy "%s" to "%s" because target file could not be opened for writing.', $originFile, $targetFile), 0, null, $originFile);
6464
}
6565

@@ -647,7 +647,7 @@ public function tempnam($dir, $prefix)
647647

648648
// Use fopen instead of file_exists as some streams do not support stat
649649
// Use mode 'x+' to atomically check existence and create to avoid a TOCTOU vulnerability
650-
$handle = @fopen($tmpFile, 'x+b');
650+
$handle = @fopen($tmpFile, 'x+');
651651

652652
// If unsuccessful restart the loop
653653
if (false === $handle) {

0 commit comments

Comments
 (0)