Skip to content

Commit

Permalink
Fallback to user id if owner is not available and set inline csp to f…
Browse files Browse the repository at this point in the history
…ix issues with android webview

Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Jan 16, 2020
1 parent 4c6e73b commit 8284c24
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Controller/StaticController.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ private function createFileResponse($path) {
}

$csp = new ContentSecurityPolicy();
$csp->addAllowedScriptDomain('\'strict-dynamic\'');
$csp->addAllowedScriptDomain('\'unsafe-eval\'');
$csp->addAllowedScriptDomain('\'unsafe-inline\'');
$csp->addAllowedFrameDomain($this->request->getServerHost());
$response->setContentSecurityPolicy($csp);

Expand Down
3 changes: 2 additions & 1 deletion lib/OnlyOffice/AutoConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,6 @@ private function autoConfig() {

$this->appConfig->SetDefaultFormats($defaultFormats);
$this->appConfig->SetEditableFormats($editFormats);
$this->appConfig->SetSameTab(true);
}
}
}
2 changes: 2 additions & 0 deletions lib/OnlyOffice/URLDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ public function getFileForToken(string $token): ?File {
$userId = $this->userSession->getUser()->getUID();
} else if (isset($hashData->ownerId)) {
$userId = $hashData->ownerId;
} else if (isset($hashData->userId)) {
$userId = $hashData->userId;
} else {
throw new \Exception("Can't get owner id from document url");
}
Expand Down

0 comments on commit 8284c24

Please sign in to comment.