fix: change mxc regex pattern
This commit is contained in:
1 parent
70d9db6cbf
commit
5c6cd29a05
1 file changed
+1
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user