Skip to content

Commit

Permalink
fixup! Move to more generic way of parsing wopi discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusknorr committed Jan 5, 2023
1 parent 05893fe commit 6f9402c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/Command/ActivateConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ protected function execute(InputInterface $input, OutputInterface $output) {
$this->discoveryManager->refetch();
$this->capabilitiesService->clear();
$capaUrlSrc = $this->wopiParser->getUrlSrc('Capabilities');
if (is_array($capaUrlSrc) && $capaUrlSrc['action'] === 'getinfo') {
if ($capaUrlSrc['action'] === 'getinfo') {
$public_wopi_url = str_replace('/hosting/capabilities', '', $capaUrlSrc['urlsrc']);
if ($public_wopi_url !== null) {
$this->appConfig->setAppValue('public_wopi_url', $public_wopi_url);
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public function setSettings($wopi_url,
$this->capabilitiesService->clear();
try {
$capaUrlSrc = $this->wopiParser->getUrlSrc('Capabilities');
if (is_array($capaUrlSrc) && $capaUrlSrc['action'] === 'getinfo') {
if ($capaUrlSrc['action'] === 'getinfo') {
$public_wopi_url = str_replace('/hosting/capabilities', '', $capaUrlSrc['urlsrc']);
if ($public_wopi_url !== null) {
$this->appConfig->setAppValue('public_wopi_url', $public_wopi_url);
Expand Down
4 changes: 2 additions & 2 deletions lib/WOPI/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ private function getUrlSrcByExtension(string $netZoneName, string $actionExt, $a
$netZoneName, $actionExt, $actionName
));

if (!$result || count($result) === 0) {
if (!$result) {
return null;
}

Expand All @@ -237,7 +237,7 @@ private function getUrlSrcByMimetype(string $netZoneName, string $mimetype): ?st
$netZoneName, $mimetype
));

if (!$result || count($result) === 0) {
if (!$result) {
return null;
}

Expand Down

0 comments on commit 6f9402c

Please sign in to comment.