fix generation of an url to an absolute ocs route when NC in subfolder

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2019-11-29 11:14:21 +01:00
parent 6a940d5c74
commit b57d8b92d6
No known key found for this signature in database
GPG Key ID: 7424F1874854DF23
1 changed files with 3 additions and 2 deletions

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