aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-12-04 11:49:06 +0100
committerGitHub <noreply@github.com>2019-12-04 11:49:06 +0100
commitd4f1cc7da6a2d7834099750827a50dcc675c64e5 (patch)
treee32a4b4889500cd25d940d9d4dc99f60f04b9265 /lib
parent17eece7fc4470828c3b03d44e0614e70848260a4 (diff)
parentb57d8b92d6c56e419b86a12bfa75ee683d92b9ac (diff)
downloadnextcloud-server-d4f1cc7da6a2d7834099750827a50dcc675c64e5.tar.gz
nextcloud-server-d4f1cc7da6a2d7834099750827a50dcc675c64e5.zip
Merge pull request #18161 from nextcloud/fix/noid/absocsroute-subfolder
fix generation of an url to an absolute ocs route when NC in subfolder
Diffstat (limited to 'lib')
-rw-r--r--lib/private/URLGenerator.php5
1 files 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);