Merge pull request #11772 from nextcloud/stable14-pretty-urls-dont-work

[14] Allow overwrite.cli.url without trailing slash
This commit is contained in:
Morris Jobke 2018-10-19 12:16:22 +02:00 committed by GitHub
commit 2885db8e9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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 : '/';
}