Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite483eee

Browse files
bug#54471 [Filesystem] Strengthen the check of file permissions indumpFile (alexandre-daubois)
This PR was merged into the 5.4 branch.Discussion----------[Filesystem] Strengthen the check of file permissions in `dumpFile`| Q | A| ------------- | ---| Branch? | 5.4| Bug fix? | yes| New feature? | no| Deprecations? | no| Issues |Fix#54444| License | MIT`fileperms()` can fail and return `false`, I think we should strengthen the checks on its return value when using it to avoid undesirable behavior.Commits-------0c17a4e [Filesystem] Strengthen the check of file permissions in `dumpFile`
2 parentse9a7cb9 +0c17a4e commite483eee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/Symfony/Component/Filesystem/Filesystem.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ public function dumpFile(string $filename, $content)
691691
thrownewIOException(sprintf('Failed to write file "%s":',$filename).self::$lastError,0,null,$filename);
692692
}
693693

694-
self::box('chmod',$tmpFile,file_exists($filename) ?fileperms($filename) :0666 & ~umask());
694+
self::box('chmod',$tmpFile,@fileperms($filename)?:0666 & ~umask());
695695

696696
$this->rename($tmpFile,$filename,true);
697697
}finally {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp