summaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework
diff options
context:
space:
mode:
authorStanimir Bozhilov <stanimir@audriga.com>2022-12-08 15:11:23 +0100
committerStanimir Bozhilov <stanimir@audriga.com>2022-12-08 15:11:23 +0100
commitb44befa8812a38ab29171480572f8581f3b970ad (patch)
treef222c32809d74102947d354ff01f4761cb42eb54 /lib/private/AppFramework
parent46c10c77e1d5f1b46e665995f9030ccd74283af7 (diff)
downloadnextcloud-server-b44befa8812a38ab29171480572f8581f3b970ad.tar.gz
nextcloud-server-b44befa8812a38ab29171480572f8581f3b970ad.zip
Move JSON content type regex to IRequest and make it a const
Diffstat (limited to 'lib/private/AppFramework')
-rw-r--r--lib/private/AppFramework/Http/Request.php5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php
index e4219cefd70..3764ce5c7f8 100644
--- a/lib/private/AppFramework/Http/Request.php
+++ b/lib/private/AppFramework/Http/Request.php
@@ -107,9 +107,6 @@ class Request implements \ArrayAccess, \Countable, IRequest {
/** @var bool */
protected $contentDecoded = false;
- /** @var string */
- protected string $jsonContentTypeRegex = '{^application/(?:[a-z0-9.-]+\+)?json\b}';
-
/**
* @param array $vars An associative array with the following optional values:
* - array 'urlParams' the parameters which were matched from the URL
@@ -433,7 +430,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
$params = [];
// 'application/json' and other JSON-related content types must be decoded manually.
- if (preg_match($this->jsonContentTypeRegex, $this->getHeader('Content-Type')) === 1) {
+ if (preg_match(self::JSON_CONTENT_TYPE_REGEX, $this->getHeader('Content-Type')) === 1) {
$params = json_decode(file_get_contents($this->inputStream), true);
if ($params !== null && \count($params) > 0) {
$this->items['params'] = $params;