-
-
Notifications
You must be signed in to change notification settings - Fork 366
Fix PHP 8.5 $http_response_header deprecation #841
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
+7
−0
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
DannyvdSluijs
added a commit
that referenced
this pull request
Sep 9, 2025
This fixes a regression introduced in #841 If a process/request runs: - file_get_contents on an HTTP URL. - then a json-schema validation using a file://... URL as schema (not all schema are remotely loaded) - and `http_get_last_response_headers()` is available Then you end up with: - file_get_contents on the URL fills up the headers of that request - json-schema validation loads the schema file but using file:// there are no headers, and it seems like file_get_contents does not clear previous headers itself - http_get_last_response_headers() then returns the headers of the previous request - and then `$this->fetchContentType()` will fail unless the response headers were of the correct `application/schema+json` mime type (which is very unlikely). So this PR clears the headers before we fetch the schema, to make sure we have a clean slate. I'll probably report this to PHP as well because IMO it is a bit surprising. --------- Co-authored-by: Danny van der Sluijs <[email protected]>
|
Any chance this deprecation could be backported to 5.x ? I'm using |
Collaborator
Author
Hi @gnutix There is a 5.x.x branch for which you can create a port based on this PR. I can do the merging and releasing. |
12 tasks
DannyvdSluijs
added a commit
that referenced
this pull request
Dec 12, 2025
## Description This PR will run the workflows (excluding phpstan) on the 5.x.x branch ## Related Issue #841 #857 ## Type of Change - [X] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update - [ ] Code refactoring - [ ] Other (please describe): ## Checklist <!-- Mark completed items with an "x" --> - [X] I have read the [CONTRIBUTING](CONTRIBUTING.md) guidelines - [X] My code follows the code style of this project - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] All new and existing tests pass - [ ] I have updated the documentation accordingly - [X] My changes generate no new warnings ## Additional Notes This should allow the run of workflows for #857 and future PR's against the 5.x.x branch
DannyvdSluijs
pushed a commit
that referenced
this pull request
Dec 12, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Replaces #840 (due to blocked write access on fork)