Skip to content

Commit

Permalink
Use richdocuments app config for querying wopi url
Browse files Browse the repository at this point in the history
  • Loading branch information
kulmann committed Jul 8, 2021
1 parent 87e6d18 commit edd7b50
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/web-integration-oc10/lib/Controller/FilesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ private function getOnlyOfficeDocumentServerUrl(): string {
if (!class_exists("\OCA\Onlyoffice\AppConfig")) {
return "";
}
$onlyofficeConfig = new \OCA\Onlyoffice\AppConfig("onlyoffice");
$onlyofficeConfig = \OC::$server->query(\OCA\Onlyoffice\AppConfig::class);
return $onlyofficeConfig->GetDocumentServerUrl();
}

Expand All @@ -168,15 +168,14 @@ private function applyCSPRichDocuments(ContentSecurityPolicy $csp): ContentSecur
* - https://github.com/owncloud/richdocuments/blob/9a23f426048c540793fc16119f71a44c26077f16/lib/Controller/DocumentController.php#L393
*
* @return string
* @throws \OCP\AppFramework\QueryException
*/
private function getRichDocumentsServerUrl(): string {
$appName = 'richdocuments';
$documentServerKey = 'wopi_url';
$documentServerUrl = $this->config->getAppValue($appName, $documentServerKey);
if (!empty($documentServerUrl)) {
return $documentServerUrl;
if (!class_exists("\OCA\Richdocuments\AppConfig")) {
return "";
}
return "";
$richdocumentsConfig = \OC::$server->query(\OCA\Richdocuments\AppConfig::class);
return $richdocumentsConfig->getAppValue('wopi_url');
}

/**
Expand Down

0 comments on commit edd7b50

Please sign in to comment.