Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Nextcloud prevent confusion by using /run/ instead of /app/ in routes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
the-djmaze committed Oct 12, 2022
1 parent a9a5fbb commit 2a274f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
4 changes: 2 additions & 2 deletions integrations/nextcloud/snappymail/appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
],
[
'name' => 'page#appGet',
'url' => '/app/',
'url' => '/run/',
'verb' => 'GET'
],
[
'name' => 'page#appPost',
'url' => '/app/',
'url' => '/run/',
'verb' => 'POST'
],
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,7 @@ public static function startApp(bool $api = false)
*/
public static function getAppUrl()
{
$sRequestUri = \OC::$server->getURLGenerator()->linkToRoute('snappymail.page.appGet');
if ($sRequestUri) {
return $sRequestUri;
}
$sRequestUri = empty($_SERVER['REQUEST_URI']) ? '': \trim($_SERVER['REQUEST_URI']);
$sRequestUri = \preg_replace('/index.php\/.+$/', 'index.php/', $sRequestUri);
$sRequestUri = $sRequestUri.'apps/snappymail/app/';
return '/'.\ltrim($sRequestUri, '/\\');
return \OC::$server->getURLGenerator()->linkToRoute('snappymail.page.appGet');
}

/**
Expand Down

0 comments on commit 2a274f0

Please sign in to comment.