diff options
author | szaimen <szaimen@e.mail.de> | 2022-03-03 18:08:08 +0100 |
---|---|---|
committer | szaimen <szaimen@e.mail.de> | 2022-03-09 22:26:00 +0100 |
commit | 4191a178dd53f2c77b52d845ad802e3d87519564 (patch) | |
tree | fe1c574353d25c3866f661e98a00d4be13bddd66 /apps/settings/lib | |
parent | 787f4f02b361eec1eddf08709905ed4b5d250a48 (diff) | |
download | nextcloud-server-4191a178dd53f2c77b52d845ad802e3d87519564.tar.gz nextcloud-server-4191a178dd53f2c77b52d845ad802e3d87519564.zip |
improve overwrite cli url setup check
Signed-off-by: szaimen <szaimen@e.mail.de>
Diffstat (limited to 'apps/settings/lib')
-rw-r--r-- | apps/settings/lib/Controller/CheckSetupController.php | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/apps/settings/lib/Controller/CheckSetupController.php b/apps/settings/lib/Controller/CheckSetupController.php index 11900fad45b..eeaf45d0ec5 100644 --- a/apps/settings/lib/Controller/CheckSetupController.php +++ b/apps/settings/lib/Controller/CheckSetupController.php @@ -609,15 +609,14 @@ Raw output } protected function getSuggestedOverwriteCliURL(): string { - $suggestedOverwriteCliUrl = ''; - if ($this->config->getSystemValue('overwrite.cli.url', '') === '') { - $suggestedOverwriteCliUrl = $this->request->getServerProtocol() . '://' . $this->request->getInsecureServerHost() . \OC::$WEBROOT; - if (!$this->config->getSystemValue('config_is_read_only', false)) { - // Set the overwrite URL when it was not set yet. - $this->config->setSystemValue('overwrite.cli.url', $suggestedOverwriteCliUrl); - $suggestedOverwriteCliUrl = ''; - } + $currentOverwriteCliUrl = $this->config->getSystemValue('overwrite.cli.url', ''); + $suggestedOverwriteCliUrl = $this->request->getServerProtocol() . '://' . $this->request->getInsecureServerHost() . \OC::$WEBROOT; + + // Check correctness by checking if it is a valid URL + if (filter_var($currentOverwriteCliUrl, FILTER_VALIDATE_URL)) { + $suggestedOverwriteCliUrl = ''; } + return $suggestedOverwriteCliUrl; } |