fix: change mxc regex pattern
This commit is contained in:
@@ -28,7 +28,7 @@ suspend fun getHomeserver(url: String): String? {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun mxcToUrl(mxc: 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)
|
val match = pattern.find(mxc)
|
||||||
|
|
||||||
if ((match?.groupValues[1] == null) or (match?.groupValues[2] == null)) return null
|
if ((match?.groupValues[1] == null) or (match?.groupValues[2] == null)) return null
|
||||||
|
|||||||
Reference in New Issue
Block a user