diff --git a/lib/private/Setup.php b/lib/private/Setup.php index 25e0b4d88173b..1b36a7ee0cd26 100644 --- a/lib/private/Setup.php +++ b/lib/private/Setup.php @@ -438,16 +438,15 @@ public static function updateHtaccess() { $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 : '/'; }