Skip to content

Commit

Permalink
Merge pull request #11772 from nextcloud/stable14-pretty-urls-dont-work
Browse files Browse the repository at this point in the history
[14] Allow overwrite.cli.url without trailing slash
  • Loading branch information
MorrisJobke authored Oct 19, 2018
2 parents c1fbf70 + 4f983b7 commit 2885db8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/private/Setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 : '/';
}
Expand Down

0 comments on commit 2885db8

Please sign in to comment.