diff --git a/appinfo/routes.php b/appinfo/routes.php index 4efdf450..1f51219d 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -8,7 +8,9 @@ ['name' => 'Config#setAdminConfig', 'url' => '/admin-config', 'verb' => 'PUT'], // Menu Entries - ['name' => 'TopMenu#viewExAppPage', 'url' => '/embedded/{appId}/{name}', 'verb' => 'GET' , 'root' => '/embedded'], + ['name' => 'TopMenu#viewExAppPage', + 'url' => '/embedded/{appId}/{name}', 'verb' => 'GET' , 'root' => '/embedded', + 'requirements' => array('name' => '.+')], ['name' => 'TopMenu#ExAppIcon', 'url' => '/embedded/{appId}/{name}/icon', 'verb' => 'GET' , 'root' => '/embedded'], // Proxy diff --git a/lib/Controller/TopMenuController.php b/lib/Controller/TopMenuController.php index dae688b7..c5abad9b 100644 --- a/lib/Controller/TopMenuController.php +++ b/lib/Controller/TopMenuController.php @@ -42,11 +42,17 @@ public function __construct( /** * @NoCSRFRequired * @NoAdminRequired + * @param string $appId + * @param string $name + * @return TemplateResponse * @throws Exception */ #[NoAdminRequired] #[NoCSRFRequired] public function viewExAppPage(string $appId, string $name): TemplateResponse { + if (str_ends_with($name, '/')) { + $name = substr($name, 0, -1); + } $exApp = $this->service->getExApp($appId); if ($exApp === null) { return new NotFoundResponse();