Digits appear in some currency codes in the ledger history.

We need to figure out what the exact allowed character set is - if there are any
restrictions.
This commit is contained in:
Stefan Thomas
2013-08-23 15:13:31 -07:00
parent 6fa2a220e7
commit d5fb086b51

View File

@@ -92,7 +92,7 @@ Currency.prototype.parse_bytes = function (byte_array) {
}
if (isZeroExceptInStandardPositions) {
var currencyCode = String.fromCharCode(byte_array[12]) + String.fromCharCode(byte_array[13]) + String.fromCharCode(byte_array[14]);
if (/^[A-Z]{3}$/.test(currencyCode) && currencyCode !== "XRP" ) {
if (/^[A-Z0-9]{3}$/.test(currencyCode) && currencyCode !== "XRP" ) {
this._value = currencyCode;
} else if (currencyCode === "\0\0\0") {
this._value = 0;