Skip to content

Commit

Permalink
fix internal route when using occ
Browse files Browse the repository at this point in the history
Signed-off-by: Maxence Lange <[email protected]>
  • Loading branch information
ArtificialOwl committed May 4, 2023
1 parent 243c204 commit 65b0b4b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Service/ConfigService.php
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,12 @@ public function linkToRoute(string $route, array $args): string {
$path = $this->urlGenerator->linkToRoute($route, $args);

if (OC::$CLI) {
// when running from the occ command, /index.php is not removed by itself
if (str_starts_with($path, '/index.php/')
&& $this->config->getSystemValueString('htaccess.RewriteBase', '') !== '') {
$path = $this->config->getSystemValueString('htaccess.RewriteBase', '/') . substr($path, 11);
}

$knownPath = parse_url($this->config->getSystemValue('overwrite.cli.url'), PHP_URL_PATH);
} else {
$knownPath = OC::$WEBROOT;
Expand Down

0 comments on commit 65b0b4b

Please sign in to comment.