From b57d8b92d6c56e419b86a12bfa75ee683d92b9ac Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Fri, 29 Nov 2019 11:14:21 +0100 Subject: [PATCH] fix generation of an url to an absolute ocs route when NC in subfolder Signed-off-by: Arthur Schiwon --- lib/private/URLGenerator.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/private/URLGenerator.php b/lib/private/URLGenerator.php index 167690f3a6e..1fb69031f03 100644 --- a/lib/private/URLGenerator.php +++ b/lib/private/URLGenerator.php @@ -94,8 +94,9 @@ class URLGenerator implements IURLGenerator { public function linkToOCSRouteAbsolute(string $routeName, array $arguments = []): string { $route = \OC::$server->getRouter()->generate('ocs.'.$routeName, $arguments, false); - if (strpos($route, '/index.php') === 0) { - $route = substr($route, 10); + $indexPhpPos = strpos($route, '/index.php/'); + if ($indexPhpPos !== false) { + $route = substr($route, $indexPhpPos + 10); } $route = substr($route, 7); -- 2.39.5