From 8f660e990bfbd23b95a8ff81f1b6eaf7aebea060 Mon Sep 17 00:00:00 2001 From: Andreas Hennings Date: Thu, 7 Nov 2024 17:11:44 +0100 Subject: [PATCH] Issue #43: Explicitly return NULL, to avoid inconsistent return points. --- src/Cool/CoolRequest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Cool/CoolRequest.php b/src/Cool/CoolRequest.php index 73c6a9b3..5f2701ce 100644 --- a/src/Cool/CoolRequest.php +++ b/src/Cool/CoolRequest.php @@ -140,36 +140,36 @@ public function getWopiClientURL() { $wopi_client_server = $default_config->get('cool')['server']; if (!$wopi_client_server) { $this->error_code = 201; - return; + return NULL; } $wopi_client_server = trim($wopi_client_server); if (!strStartsWith($wopi_client_server, 'http')) { $this->error_code = 204; - return; + return NULL; } if (!strStartsWith($wopi_client_server, $_HOST_SCHEME . '://')) { $this->error_code = 202; - return; + return NULL; } $discovery = getDiscovery($wopi_client_server); if ($discovery === false) { $this->error_code = 203; - return; + return NULL; } $discovery_parsed = simplexml_load_string($discovery); if (!$discovery_parsed) { $this->error_code = 102; - return; + return NULL; } $this->wopi_src = strval(getWopiSrcUrl($discovery_parsed, 'text/plain')[0]); if (!$this->wopi_src) { $this->error_code = 103; - return; + return NULL; } return $this->wopi_src;