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

[HttpFoundation] Fix support for\SplTempFileObject inBinaryFileResponse#58712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

elementaire
Copy link
Contributor

@elementaireelementaire commentedOct 29, 2024
edited
Loading

QA
Branch?7.1
Bug fix?yes
PR original Feature#49144
New feature?no
Deprecations?no
Issues-
LicenseMIT

We can not call some methods with an object of\SplTempFileObject(). We get this error:[...] stat failed for php://temp.

I have checked the code against methods listed inthis note.

I have found:

  • getMTime() called inBinaryFileResponse::setAutoLastModified()
  • getSize() called inBinaryFileResponse::prepare()
  • isReadable() called inBinaryFileResponse::setFile() (already safe)

I have updated the unit test and patched the classBinaryFileResponse.

Note: callingSplFileObject::fstat() givesmtime equals to0. I think it is nonsense to use that as value for last modified. I have decided to usetime() because i guess, we can not do better. Indeed, we have no idea how much time have passed between making the temp file and the call tosetAutoLastModified() by the developper.

@carsonbotcarsonbot added this to the7.1 milestoneOct 29, 2024
@elementaireelementaire changed the title[HttpFoundation] Fix support for \SplTempFileObject in BinaryFileResponse[HttpFoundation] Fix support for\SplTempFileObject inBinaryFileResponseOct 29, 2024
@nicolas-grekas
Copy link
Member

Thank you@elementaire.

elementaire reacted with thumbs up emoji

@nicolas-grekasnicolas-grekas merged commit4829c82 intosymfony:7.1Nov 5, 2024
9 of 10 checks passed
This was referencedNov 6, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@xabbuhxabbuhxabbuh left review comments

Assignees
No one assigned
Projects
None yet
Milestone
7.1
Development

Successfully merging this pull request may close these issues.

4 participants
@elementaire@nicolas-grekas@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp