diff --git a/core/Controller/UnifiedSearchController.php b/core/Controller/UnifiedSearchController.php index 93fbb323ee560..d78e4a96086c8 100644 --- a/core/Controller/UnifiedSearchController.php +++ b/core/Controller/UnifiedSearchController.php @@ -123,9 +123,16 @@ protected function getRouteInformation(string $url): array { if ($url !== '') { $urlParts = parse_url($url); + $urlPath = $urlParts['path']; + + // Optionally strip webroot from URL + $webroot = \OC::$WEBROOT; + if ($webroot !== '' && substr($urlPath, 0, strlen($webroot))) { + $urlPath = substr($urlPath, strlen($webroot)); + } try { - $parameters = $this->router->findMatchingRoute($urlParts['path']); + $parameters = $this->router->findMatchingRoute($urlPath); // contacts.PageController.index => contacts.Page.index $route = $parameters['caller'];