fix: change mxc regex pattern

This commit is contained in:
2025-11-04 23:32:22 +03:00
parent 70d9db6cbf
commit 5c6cd29a05
@@ -28,7 +28,7 @@ suspend fun getHomeserver(url: String): String? {
}
fun mxcToUrl(mxc: String): String? {
val pattern = Regex("mxc://([-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6})/([a-zA-Z0-9]+)")
val pattern = Regex("mxc://([-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6})/([^#?]+)")
val match = pattern.find(mxc)
if ((match?.groupValues[1] == null) or (match?.groupValues[2] == null)) return null