Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorSimon L <szaimen@e.mail.de>2022-03-10 14:40:59 +0300
committerGitHub <noreply@github.com>2022-03-10 14:40:59 +0300
commit3a0b934f842b01973f7d56f7e46a618a28680cd3 (patch)
tree8102594e96f0176ac75dfc121dddce2d74927bcc /apps
parent53e42bd30864d49ef2a831a6319798544c4647df (diff)
parent4191a178dd53f2c77b52d845ad802e3d87519564 (diff)
Merge pull request #31430 from nextcloud/enh/31429/improve-overwrite-cli-url-check
Validate `overwrite.cli.url` to be a url in setup check
Diffstat (limited to 'apps')
-rw-r--r--apps/settings/lib/Controller/CheckSetupController.php15
1 files changed, 7 insertions, 8 deletions
diff --git a/apps/settings/lib/Controller/CheckSetupController.php b/apps/settings/lib/Controller/CheckSetupController.php
index 37305f3edf5..5225cd04f09 100644
--- a/apps/settings/lib/Controller/CheckSetupController.php
+++ b/apps/settings/lib/Controller/CheckSetupController.php
@@ -614,15 +614,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;
}