summaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework
diff options
context:
space:
mode:
authorArtur Neumann <artur@jankaritech.com>2022-12-15 13:06:02 +0545
committerArtur Neumann <artur@jankaritech.com>2022-12-15 13:45:22 +0545
commit81f2857f340464d996caf454bb38e27a7fb970c1 (patch)
tree158523fd48885aee5c08f2615df6a7ecedca5461 /lib/private/AppFramework
parent0d6a706bc08e40fad013bc7f0d07e6c0b71d27f9 (diff)
downloadnextcloud-server-81f2857f340464d996caf454bb38e27a7fb970c1.tar.gz
nextcloud-server-81f2857f340464d996caf454bb38e27a7fb970c1.zip
check if params given to API are really an array
Signed-off-by: Artur Neumann <artur@jankaritech.com>
Diffstat (limited to 'lib/private/AppFramework')
-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'