]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix generation of an url to an absolute ocs route when NC in subfolder 18161/head
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Fri, 29 Nov 2019 10:14:21 +0000 (11:14 +0100)
committerArthur Schiwon <blizzz@arthur-schiwon.de>
Fri, 29 Nov 2019 10:14:21 +0000 (11:14 +0100)
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
lib/private/URLGenerator.php

index 167690f3a6e36c6fbb60cda1d88cead9ecab0136..1fb69031f034fdb363878ae43eeb818b0d0afe33 100644 (file)
@@ -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);