diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-11-29 11:14:21 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-11-29 11:14:21 +0100 |
commit | b57d8b92d6c56e419b86a12bfa75ee683d92b9ac (patch) | |
tree | 96b7e18e7031cc27b20040e235a62118a9b751be /lib | |
parent | 6a940d5c742490e4e891f675e3f45b5f975cf650 (diff) | |
download | nextcloud-server-b57d8b92d6c56e419b86a12bfa75ee683d92b9ac.tar.gz nextcloud-server-b57d8b92d6c56e419b86a12bfa75ee683d92b9ac.zip |
fix generation of an url to an absolute ocs route when NC in subfolder
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/URLGenerator.php | 5 |
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); |