Merge pull request #379 from cypherstack/validate-epicboxaddress-has-domain

Add check for domain for epicbox address
This commit is contained in:
Diego Salazar 2023-03-01 17:25:44 -07:00 committed by GitHub
commit 9abcb65747
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1816,6 +1816,11 @@ class EpicCashWallet extends CoinServiceAPI
@override @override
bool validateAddress(String address) { bool validateAddress(String address) {
//Invalid address that contains HTTP and epicbox domain
if ((address.startsWith("http://") || address.startsWith("https://")) &&
address.contains("@")) {
return false;
}
if (address.startsWith("http://") || address.startsWith("https://")) { if (address.startsWith("http://") || address.startsWith("https://")) {
if (Uri.tryParse(address) != null) { if (Uri.tryParse(address) != null) {
return true; return true;
@ -1824,7 +1829,11 @@ class EpicCashWallet extends CoinServiceAPI
String validate = validateSendAddress(address); String validate = validateSendAddress(address);
if (int.parse(validate) == 1) { if (int.parse(validate) == 1) {
//Check if address contrains a domain
if (address.contains("@")) {
return true; return true;
}
return false;
} else { } else {
return false; return false;
} }