Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

console: Sanitization in inputBlockNumberFormatter #76

Merged
merged 2 commits into from
Aug 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading