diff options
-rw-r--r-- | lib/AppInfo/Application.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index c2e78e3b..7b72e938 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -167,18 +167,24 @@ class Application extends App { if ($this->getContainer()->getServer()->getAppManager()->isEnabledForUser($CODEAppID)) { $appConfig = $this->getContainer()->query(AppConfig::class); $wopi_url = $appConfig->getAppValue('wopi_url'); + $isCODEEnabled = strpos($wopi_url, 'proxy.php?req=') !== false; - // Check if we have the wopi_url set currently - if ($wopi_url !== null && $wopi_url !== '') { + // Check if we have the wopi_url set to custom currently + if ($wopi_url !== null && $wopi_url !== '' && $isCODEEnabled === false) { return; } $urlGenerator = \OC::$server->getURLGenerator(); $relativeUrl = $urlGenerator->linkTo($CODEAppID, '') . 'proxy.php'; $absoluteUrl = $urlGenerator->getAbsoluteURL($relativeUrl); - $wopi_url = $absoluteUrl . '?req='; + $new_wopi_url = $absoluteUrl . '?req='; - $appConfig->setAppValue('wopi_url', $wopi_url); + // Check if the wopi url needs to be updated + if ($isCODEEnabled && $wopi_url === $new_wopi_url) { + return; + } + + $appConfig->setAppValue('wopi_url', $new_wopi_url); $appConfig->setAppValue('disable_certificate_verification', 'yes'); $discoveryManager = $this->getContainer()->query(DiscoveryManager::class); |