From 9c1f68abb4918075d1c1305a91577a990b7ab1a1 Mon Sep 17 00:00:00 2001 From: Marcel Hibbe Date: Tue, 21 May 2024 12:10:09 +0200 Subject: [PATCH] fix regex and brackets for isInstanceInternalFileShareUrl only links without index.php returned true without this fix. Signed-off-by: Marcel Hibbe --- app/src/main/java/com/nextcloud/talk/utils/UriUtils.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/utils/UriUtils.kt b/app/src/main/java/com/nextcloud/talk/utils/UriUtils.kt index 4f2bb367b..1529ed258 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/UriUtils.kt +++ b/app/src/main/java/com/nextcloud/talk/utils/UriUtils.kt @@ -22,8 +22,8 @@ class UriUtils { fun isInstanceInternalFileShareUrl(baseUrl: String, url: String): Boolean { // https://cloud.nextcloud.com/f/41 - return url.startsWith("$baseUrl/f/") || url.startsWith("$baseUrl/index.php/f/") && - Regex(".*/f/d*").matches(url) + return (url.startsWith("$baseUrl/f/") || url.startsWith("$baseUrl/index.php/f/")) && + Regex(".*/f/\\d*").matches(url) } fun extractInstanceInternalFileShareFileId(url: String): String {