diff --git a/src/components/modals/main/settings/sections/background/Custom.jsx b/src/components/modals/main/settings/sections/background/Custom.jsx index 8b7135d3..69aa6ef4 100644 --- a/src/components/modals/main/settings/sections/background/Custom.jsx +++ b/src/components/modals/main/settings/sections/background/Custom.jsx @@ -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'), diff --git a/src/modules/helpers/marketplace.js b/src/modules/helpers/marketplace.js index 74bd4b70..50233f1a 100644 --- a/src/modules/helpers/marketplace.js +++ b/src/modules/helpers/marketplace.js @@ -12,7 +12,7 @@ function sleep(ms) { // based on https://stackoverflow.com/questions/37684/how-to-replace-plain-urls-with-links export function urlParser(input) { const urlPattern = - /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()!@:%_+.~#?&//=]*)/; return input.replace(urlPattern, '
$&'); } diff --git a/src/modules/helpers/settings/modals.js b/src/modules/helpers/settings/modals.js index c2988b0c..24aa52a0 100644 --- a/src/modules/helpers/settings/modals.js +++ b/src/modules/helpers/settings/modals.js @@ -144,7 +144,7 @@ export function isValidUrl(url) { // 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()!@:%_.~#?&=]*)/; return urlRegex.test(url); }