diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-06-01 12:21:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-01 12:21:26 +0200 |
commit | cf4ff7716ef3944693c0d9fe634c2e99b40435f9 (patch) | |
tree | 14b21325a67d5cfbdb3b43b1bc0646e77e3dd61d /lib | |
parent | 5c92da22694805cf36842f5dbfebbaf09308354d (diff) | |
parent | 188a41a2befea4e34dcb3d1a7b9e4499e2312f7f (diff) | |
download | nextcloud-server-cf4ff7716ef3944693c0d9fe634c2e99b40435f9.tar.gz nextcloud-server-cf4ff7716ef3944693c0d9fe634c2e99b40435f9.zip |
Merge pull request #9694 from nextcloud/backport/9692/stable13
[stable13] Make sure the log doesn't try to read from PUT if it can't
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Log.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/private/Log.php b/lib/private/Log.php index bed0321bef3..418d388e380 100644 --- a/lib/private/Log.php +++ b/lib/private/Log.php @@ -293,8 +293,16 @@ class Log implements ILogger { if(isset($logCondition['shared_secret'])) { $request = \OC::$server->getRequest(); + if ($request->getMethod() === 'PUT' && + strpos($request->getHeader('Content-Type'), 'application/x-www-form-urlencoded') === false && + strpos($request->getHeader('Content-Type'), 'application/json') === false) { + $logSecretRequest = ''; + } else { + $logSecretRequest = $request->getParam('log_secret', ''); + } + // if token is found in the request change set the log condition to satisfied - if($request && hash_equals($logCondition['shared_secret'], $request->getParam('log_secret', ''))) { + if ($request && hash_equals($logCondition['shared_secret'], $logSecretRequest)) { $this->logConditionSatisfied = true; } } |