Skip to content

Commit

Permalink
Merge pull request #76 from hyunsooda/console-input-sanitization
Browse files Browse the repository at this point in the history
console: Sanitization in inputBlockNumberFormatter
  • Loading branch information
blukat29 authored Aug 30, 2024
2 parents c2d06a2 + 1811b01 commit 149854d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion console/jsre/deps/web3.js
Original file line number Diff line number Diff line change
Expand Up @@ -3848,8 +3848,10 @@ var inputBlockNumberFormatter = function (blockNumber) {
return undefined;
} else if (isPredefinedBlockNumber(blockNumber)) {
return blockNumber;
} else if (/^\d+$/.test(blockNumber) || /^0x[0-9a-fA-F]+$/.test(blockNumber)) { // test if input is decmial or hex
return utils.toHex(blockNumber);
}
return utils.toHex(blockNumber);
throw new Error(`input block number(${blockNumber}) is invalid`);
};

var inputEmptyFormatter = function (a) {
Expand Down

0 comments on commit 149854d

Please sign in to comment.