From 6f9402cc3ab879e0bdfa576d537aba34bb4a6d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Thu, 5 Jan 2023 16:57:43 +0100 Subject: [PATCH] fixup! Move to more generic way of parsing wopi discovery --- lib/Command/ActivateConfig.php | 2 +- lib/Controller/SettingsController.php | 2 +- lib/WOPI/Parser.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Command/ActivateConfig.php b/lib/Command/ActivateConfig.php index cf52e60806..b48df45608 100644 --- a/lib/Command/ActivateConfig.php +++ b/lib/Command/ActivateConfig.php @@ -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); diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php index 93728448b8..9d3328afe8 100644 --- a/lib/Controller/SettingsController.php +++ b/lib/Controller/SettingsController.php @@ -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); diff --git a/lib/WOPI/Parser.php b/lib/WOPI/Parser.php index 979de55f2d..4960189a20 100644 --- a/lib/WOPI/Parser.php +++ b/lib/WOPI/Parser.php @@ -224,7 +224,7 @@ private function getUrlSrcByExtension(string $netZoneName, string $actionExt, $a $netZoneName, $actionExt, $actionName )); - if (!$result || count($result) === 0) { + if (!$result) { return null; } @@ -237,7 +237,7 @@ private function getUrlSrcByMimetype(string $netZoneName, string $mimetype): ?st $netZoneName, $mimetype )); - if (!$result || count($result) === 0) { + if (!$result) { return null; }