mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Hardening clipboardData handling in EnsInput (#11822)
This commit is contained in:
parent
e0692db7ba
commit
428b86fcf3
@ -36,15 +36,18 @@ export default class EnsInput extends Component {
|
||||
}
|
||||
|
||||
onPaste = (event) => {
|
||||
event.clipboardData.items[0].getAsString((text) => {
|
||||
const input = text.trim();
|
||||
if (
|
||||
!isBurnAddress(input) &&
|
||||
isValidHexAddress(input, { mixedCaseUseChecksum: true })
|
||||
) {
|
||||
this.props.onPaste(input);
|
||||
}
|
||||
});
|
||||
if (event.clipboardData.items?.length) {
|
||||
const clipboardItem = event.clipboardData.items[0];
|
||||
clipboardItem?.getAsString((text) => {
|
||||
const input = text.trim();
|
||||
if (
|
||||
!isBurnAddress(input) &&
|
||||
isValidHexAddress(input, { mixedCaseUseChecksum: true })
|
||||
) {
|
||||
this.props.onPaste(input);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
onChange = ({ target: { value } }) => {
|
||||
|
Loading…
Reference in New Issue
Block a user