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

Appearance settings

Commit afb7bb5

Browse filesBrowse files
bug #29764 [HttpFoundation] Check file exists before unlink (adam-mospan)
This PR was submitted for the master branch but it was squashed and merged into the 3.4 branch instead (closes #29764). Discussion ---------- [HttpFoundation] Check file exists before unlink Check file exists to prevent ErrorException | Q | A | ------------- | --- | Branch? | 2.6 <!-- see below --> | Bug fix? | yes | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #... <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> <!-- Write a short README entry for your feature/bugfix here (replace this comment block.) This will help people understand your PR and can be used as a start of the Doc PR. Additionally: - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. --> Commits ------- 1954187 [HttpFoundation] Check file exists before unlink
2 parents a1a3ffc + 1954187 commit afb7bb5
Copy full SHA for afb7bb5

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎src/Symfony/Component/HttpFoundation/BinaryFileResponse.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/BinaryFileResponse.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ public function sendContent()
305305
fclose($out);
306306
fclose($file);
307307

308-
if ($this->deleteFileAfterSend) {
308+
if ($this->deleteFileAfterSend && file_exists($this->file->getPathname())) {
309309
unlink($this->file->getPathname());
310310
}
311311

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.