]> source.dussan.org Git - nextcloud-server.git/commitdiff
Backport https://github.com/nextcloud/server/pull/11446 11772/head
authorDaniel Kesselberg <mail@danielkesselberg.de>
Thu, 11 Oct 2018 13:14:33 +0000 (15:14 +0200)
committerDaniel Kesselberg <mail@danielkesselberg.de>
Thu, 11 Oct 2018 13:14:33 +0000 (15:14 +0200)
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
lib/private/Setup.php

index 25e0b4d88173b4aa14eea2748c2416d172fcc316..1b36a7ee0cd26862aaf68ca4e6353d9d8e82221a 100644 (file)
@@ -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 : '/';
                }