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

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