fix(regex): Allow all TLDs

Fix for #627 - Updates all URL regexes to allow up to 63 octets for TLDs, which is the RFC 1034 standard (https://www.rfc-editor.org/rfc/rfc1034)
This commit is contained in:
2024-02-08 13:25:46 +01:00
parent 7179ee2a87
commit f309967214
3 changed files with 3 additions and 3 deletions

View File

@@ -125,7 +125,7 @@ export default class CustomSettings extends PureComponent {
// regex: https://ihateregex.io/expr/url/
// eslint-disable-next-line no-useless-escape
const urlRegex =
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()!@:%_.~#?&=]*)/;
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._~#=]{1,256}\.[a-zA-Z0-9()]{1,63}\b([-a-zA-Z0-9()!@:%_.~#?&=]*)/;
if (urlRegex.test(e) === false) {
return this.setState({
urlError: variables.getMessage('widgets.quicklinks.url_error'),