aboutsummaryrefslogtreecommitdiff
path: root/js/TxUtils.js
diff options
context:
space:
mode:
authorreemuru <rimuru@hiahatf.org>2022-07-21 11:55:32 -0400
committerreemuru <rimuru@hiahatf.org>2022-07-22 10:21:29 -0400
commit9e6f116bc978eb3149dca01800f0f42323bb7b69 (patch)
tree4af85fc756d1bf5265b24f3e9f66ad4b00961958 /js/TxUtils.js
parent2e2ae5c88fdc159477e8bc9ad871a892da83e935 (diff)
downloadmonzero-gui-9e6f116bc978eb3149dca01800f0f42323bb7b69.tar.gz
monzero-gui-9e6f116bc978eb3149dca01800f0f42323bb7b69.tar.xz
monzero-gui-9e6f116bc978eb3149dca01800f0f42323bb7b69.zip
TxUtils: don't show resolve for float
Add parseFloat() checks so that the 'Resolve' button for OpenAlias remains hidden. Also add a length check for one character with a dot. IP addresses will not be respected, but the whole point of domain names and OA is for facilitating human readable / user friendly information. Co-authored-by: selsta <selsta@users.noreply.github.com>
Diffstat (limited to 'js/TxUtils.js')
-rw-r--r--js/TxUtils.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/js/TxUtils.js b/js/TxUtils.js
index de79b625..49b0c34e 100644
--- a/js/TxUtils.js
+++ b/js/TxUtils.js
@@ -71,9 +71,8 @@ function checkSignature(signature) {
function isValidOpenAliasAddress(address) {
address = address.trim()
- var dot = address.indexOf('.')
- if (dot < 0)
- return false
// we can get an awful lot of valid domains, including non ASCII chars... accept anything
- return true
+ // there should be something after the .
+ // make sure it is not some kind of floating number
+ return address.length > 2 && isNaN(parseFloat(address)) && address.indexOf('.') >= 0
}