fix regex and brackets for isInstanceInternalFileShareUrl

only links without index.php returned true without this fix.

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2024-05-21 12:10:09 +02:00
parent 5242f9cd2b
commit 9c1f68abb4
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B

View File

@ -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 {