[PHP8] check if params given to API are really an array#35779
Merged
[PHP8] check if params given to API are really an array#35779
Conversation
Contributor
Author
|
/backport to stable24 |
Signed-off-by: Artur Neumann <artur@jankaritech.com>
ddc9da4 to
81f2857
Compare
Member
|
22 and 23 have reached EOL https://github.com/nextcloud/server/wiki/Maintenance-and-Release-Schedule |
Member
|
/backport to stable25 |
Contributor
Author
|
we are still supporting 22 and 23 in https://github.com/nextcloud/integration_openproject/ and that bug makes our API send too many 500 |
Member
|
failing tests unrelated (will be solved with #35789) |
This was referenced Dec 16, 2022
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
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.
Summary
A request that comes into this code but is not a JSON object but only a string will show only a Warning in PHP7 but in PHP8
count()will throw an exception that then might result in a HTTP Status 500 and log lines like"message": "count(): Argument #1 ($value) must be of type Countable|array, string given in file '/home/artur/www/nextcloud-server/lib/private/AppFramework/Http/Request.php' line 434",This PR makes sure that
$paramsis an array and if not set tonullChecklist