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
This commit is contained in:
commit
cf4ff7716e
|
@ -293,8 +293,16 @@ class Log implements ILogger {
|
||||||
if(isset($logCondition['shared_secret'])) {
|
if(isset($logCondition['shared_secret'])) {
|
||||||
$request = \OC::$server->getRequest();
|
$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 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;
|
$this->logConditionSatisfied = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue