Merge pull request #18161 from nextcloud/fix/noid/absocsroute-subfolder

fix generation of an url to an absolute ocs route when NC in subfolder
This commit is contained in:
Roeland Jago Douma 2019-12-04 11:49:06 +01:00 committed by GitHub
commit d4f1cc7da6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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);