diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-06-01 13:17:23 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-01 13:17:23 +0300 |
commit | a55241cfe667e44d02403b354a55296620fa6d16 (patch) | |
tree | 00c0ad5945af839b55e068be28e6316d5d2d0bd4 /lib/private/Log.php | |
parent | 3742d927ecd0720c100672f563fde9198f52182f (diff) | |
parent | c27722520c55d5ba96c0b40f0825a93fb10cac2f (diff) |
Merge pull request #9695 from nextcloud/backport/9692/stable12
[stable12] Make sure the log doesn't try to read from PUT if it can't
Diffstat (limited to 'lib/private/Log.php')
-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 6da23bfbaee..37ae2d0d067 100644 --- a/lib/private/Log.php +++ b/lib/private/Log.php @@ -285,8 +285,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; } } |