diff options
author | Joas Schilling <coding@schilljs.com> | 2020-03-23 17:00:41 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2020-04-18 11:21:28 +0200 |
commit | aad16c8508b11c54cd87122456642b8e20c774d3 (patch) | |
tree | b03243dfa650e1d927988bf738f9eb6aad27d071 /lib/private/Route | |
parent | 3f8168b6e5c0fc14709b713d9ca4943f9df70273 (diff) | |
download | nextcloud-server-aad16c8508b11c54cd87122456642b8e20c774d3.tar.gz nextcloud-server-aad16c8508b11c54cd87122456642b8e20c774d3.zip |
Fix creation of legacy routes
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Route')
-rw-r--r-- | lib/private/Route/Router.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/private/Route/Router.php b/lib/private/Route/Router.php index 9c6e69908e7..075b81224ad 100644 --- a/lib/private/Route/Router.php +++ b/lib/private/Route/Router.php @@ -335,6 +335,7 @@ class Router implements IRouter { if ($absolute === false) { $referenceType = UrlGenerator::ABSOLUTE_PATH; } + $name = $this->fixLegacyRootName($name); return $this->getGenerator()->generate($name, $parameters, $referenceType); } catch (RouteNotFoundException $e) { $this->logger->logException($e); @@ -342,6 +343,34 @@ class Router implements IRouter { } } + protected function fixLegacyRootName(string $routeName): string { + if ($routeName === 'files.viewcontroller.showFile') { + return 'files.View.showFile'; + } + if ($routeName === 'files_sharing.sharecontroller.showShare') { + return 'files_sharing.Share.showShare'; + } + if ($routeName === 'files_sharing.sharecontroller.showAuthenticate') { + return 'files_sharing.Share.showAuthenticate'; + } + if ($routeName === 'files_sharing.sharecontroller.authenticate') { + return 'files_sharing.Share.authenticate'; + } + if ($routeName === 'files_sharing.sharecontroller.downloadShare') { + return 'files_sharing.Share.downloadShare'; + } + if ($routeName === 'files_sharing.publicpreview.directLink') { + return 'files_sharing.PublicPreview.directLink'; + } + if ($routeName === 'cloud_federation_api.requesthandlercontroller.addShare') { + return 'cloud_federation_api.RequestHandler.addShare'; + } + if ($routeName === 'cloud_federation_api.requesthandlercontroller.receiveNotification') { + return 'cloud_federation_api.RequestHandler.receiveNotification'; + } + return $routeName; + } + /** * To isolate the variable scope used inside the $file it is required in it's own method * |