mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-29 09:52:34 +02:00
Protects against empty nip04 content
This commit is contained in:
@@ -154,6 +154,7 @@ class Nip04(
|
|||||||
|
|
||||||
fun isNIP04(encoded: String): Boolean {
|
fun isNIP04(encoded: String): Boolean {
|
||||||
val l = encoded.length
|
val l = encoded.length
|
||||||
|
if (l < 28) return false
|
||||||
return encoded[l - 28] == '?' && encoded[l - 27] == 'i' && encoded[l - 26] == 'v' && encoded[l - 25] == '='
|
return encoded[l - 28] == '?' && encoded[l - 27] == 'i' && encoded[l - 26] == 'v' && encoded[l - 25] == '='
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user