Skip to content

Conversation

@abs2023
Copy link
Contributor

@abs2023 abs2023 commented Feb 11, 2025

No description provided.

LumerinIO
LumerinIO previously approved these changes Feb 11, 2025
return false;
}
for (const elem of elems) {
const num = parseInt(elem);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of parseInt without specifying a radix can lead to unexpected results if the input contains leading zeros, as these might be interpreted as octal numbers. To ensure consistent behavior, always specify a radix of 10 when using parseInt for IP address segments.

Recommended Change:

const num = parseInt(elem, 10);

}

// Check if host is a valid domain name
const domainRegex = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regular expression used for domain name validation does not support internationalized domain names (IDNs) which can include Unicode characters. This limitation might prevent valid IDNs from being accepted.

Recommended Change:
Consider using a library or a more comprehensive regular expression that supports IDNs to enhance the domain name validation process.

@abs2023 abs2023 merged commit ba782d8 into main Feb 11, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants