Updated on 2026-08-14
This commit is contained in:
parent
7868e94865
commit
5f3c2c337a
5 changed files with 32 additions and 15 deletions
|
|
@ -6,6 +6,7 @@ import android.content.Intent
|
|||
* Key to pass deeplink via intent
|
||||
*/
|
||||
const val DEEPLINK_KEY = "deeplink"
|
||||
const val WEBLINK_KEY = "link"
|
||||
|
||||
// TODO: Add tests
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
package com.tangem.utils.extensions
|
||||
|
||||
private const val DEEPLINK_VALIDATION_REGEX = "['\";<>()+\\\\]"
|
||||
|
||||
/**
|
||||
* Check for malicious symbol in uri part
|
||||
*/
|
||||
fun String.validate(): Boolean {
|
||||
val regex = DEEPLINK_VALIDATION_REGEX.toRegex()
|
||||
|
||||
return !regex.containsMatchIn(this)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue