From 2a274f008fa419aaf9b1cade45b134c34150531b Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Wed, 12 Oct 2022 10:18:52 +0200 Subject: [PATCH] Nextcloud prevent confusion by using /run/ instead of /app/ in routes #96 --- integrations/nextcloud/snappymail/appinfo/routes.php | 4 ++-- .../nextcloud/snappymail/lib/Util/SnappyMailHelper.php | 9 +-------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/integrations/nextcloud/snappymail/appinfo/routes.php b/integrations/nextcloud/snappymail/appinfo/routes.php index a502b39e9c..ce0e24721b 100755 --- a/integrations/nextcloud/snappymail/appinfo/routes.php +++ b/integrations/nextcloud/snappymail/appinfo/routes.php @@ -9,12 +9,12 @@ ], [ 'name' => 'page#appGet', - 'url' => '/app/', + 'url' => '/run/', 'verb' => 'GET' ], [ 'name' => 'page#appPost', - 'url' => '/app/', + 'url' => '/run/', 'verb' => 'POST' ], [ diff --git a/integrations/nextcloud/snappymail/lib/Util/SnappyMailHelper.php b/integrations/nextcloud/snappymail/lib/Util/SnappyMailHelper.php index 627b3674a3..081d08ec06 100644 --- a/integrations/nextcloud/snappymail/lib/Util/SnappyMailHelper.php +++ b/integrations/nextcloud/snappymail/lib/Util/SnappyMailHelper.php @@ -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'); } /**