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 <maxence@artificial-owl.com>
  • Loading branch information
ArtificialOwl committed May 9, 2023
1 parent c24a299 commit c4bf33b
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 @@ -741,6 +741,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 c4bf33b

Please sign in to comment.