aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework/Http
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2022-12-16 11:41:36 +0100
committerGitHub <noreply@github.com>2022-12-16 11:41:36 +0100
commit2881a2f6dd19edf582ed2f2030af20bef6c25eab (patch)
tree01734f97c78cefaaef715c9a78b460d370d5cfc7 /lib/private/AppFramework/Http
parent8a0add4ecbbbcb682d5c332deabcfe0a3c56a946 (diff)
parent81f2857f340464d996caf454bb38e27a7fb970c1 (diff)
downloadnextcloud-server-2881a2f6dd19edf582ed2f2030af20bef6c25eab.tar.gz
nextcloud-server-2881a2f6dd19edf582ed2f2030af20bef6c25eab.zip
Merge pull request #35779 from nextcloud/catchTypeError
[PHP8] check if params given to API are really an array
Diffstat (limited to 'lib/private/AppFramework/Http')
-rw-r--r--lib/private/AppFramework/Http/Request.php3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php
index 496a845dd4a..286187c696c 100644
--- a/lib/private/AppFramework/Http/Request.php
+++ b/lib/private/AppFramework/Http/Request.php
@@ -431,13 +431,12 @@ class Request implements \ArrayAccess, \Countable, IRequest {
// 'application/json' must be decoded manually.
if (strpos($this->getHeader('Content-Type'), 'application/json') !== false) {
$params = json_decode(file_get_contents($this->inputStream), true);
- if ($params !== null && \count($params) > 0) {
+ if (\is_array($params) && \count($params) > 0) {
$this->items['params'] = $params;
if ($this->method === 'POST') {
$this->items['post'] = $params;
}
}
-
// Handle application/x-www-form-urlencoded for methods other than GET
// or post correctly
} elseif ($this->method !== 'GET'