Skip to content

Commit

Permalink
trigger url if backslash in the end
Browse files Browse the repository at this point in the history
  • Loading branch information
bigcat88 committed Dec 1, 2023
1 parent 383a4cb commit 6b7a0d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions lib/Controller/TopMenuController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 6b7a0d0

Please sign in to comment.