aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-10-19 12:16:22 +0200
committerGitHub <noreply@github.com>2018-10-19 12:16:22 +0200
commit2885db8e9b4800eb32a80fc01fdd73b49c1b38b6 (patch)
tree7985c4a4753371200c0d0e65ccf9a4ec63da8873
parentc1fbf70d831d4f8039f847f2ca2c96fd781052a1 (diff)
parent4f983b756519d1e3c85b5fe6fb7467e812ef53e7 (diff)
downloadnextcloud-server-2885db8e9b4800eb32a80fc01fdd73b49c1b38b6.tar.gz
nextcloud-server-2885db8e9b4800eb32a80fc01fdd73b49c1b38b6.zip
Merge pull request #11772 from nextcloud/stable14-pretty-urls-dont-work
[14] Allow overwrite.cli.url without trailing slash
-rw-r--r--lib/private/Setup.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/private/Setup.php b/lib/private/Setup.php
index 25e0b4d8817..1b36a7ee0cd 100644
--- a/lib/private/Setup.php
+++ b/lib/private/Setup.php
@@ -438,16 +438,15 @@ class Setup {
$config = \OC::$server->getSystemConfig();
// For CLI read the value from overwrite.cli.url
- if(\OC::$CLI) {
+ if (\OC::$CLI) {
$webRoot = $config->getValue('overwrite.cli.url', '');
- if($webRoot === '') {
+ if ($webRoot === '') {
return false;
}
- $webRoot = parse_url($webRoot, PHP_URL_PATH);
- if ($webRoot === null) {
+ if (!filter_var($webRoot, FILTER_VALIDATE_URL)) {
return false;
}
- $webRoot = rtrim($webRoot, '/');
+ $webRoot = rtrim(parse_url($webRoot, PHP_URL_PATH), '/');
} else {
$webRoot = !empty(\OC::$WEBROOT) ? \OC::$WEBROOT : '/';
}