-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
[PHP8] check if params given to API are really an array #35779
Conversation
/backport to stable24 |
Signed-off-by: Artur Neumann <artur@jankaritech.com>
ddc9da4
to
81f2857
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
22 and 23 have reached EOL https://github.com/nextcloud/server/wiki/Maintenance-and-Release-Schedule |
/backport to stable25 |
we are still supporting 22 and 23 in https://github.com/nextcloud/integration_openproject/ and that bug makes our API send too many 500 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
failing tests unrelated (will be solved with #35789) |
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
$params
is an array and if not set tonull
Checklist