Fix case when overwrite URL is empty during setup

Found while testing strict typing for PHP 7+.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Morris Jobke 2018-01-12 23:56:25 +01:00
parent 3dc7d0fb90
commit 82869b6d81
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
2 changed files with 4 additions and 1 deletions

View File

@ -43,7 +43,7 @@ class UpdateHtaccess extends Command {
$output->writeln('.htaccess has been updated');
return 0;
} else {
$output->writeln('<error>Error updating .htaccess file, not enough permissions?</error>');
$output->writeln('<error>Error updating .htaccess file, not enough permissions or "overwrite.cli.url" set to an invalid URL?</error>');
return 1;
}
}

View File

@ -437,6 +437,9 @@ class Setup {
return false;
}
$webRoot = parse_url($webRoot, PHP_URL_PATH);
if ($webRoot === null) {
return false;
}
$webRoot = rtrim($webRoot, '/');
} else {
$webRoot = !empty(\OC::$WEBROOT) ? \OC::$WEBROOT : '/';