mirror of
https://github.com/discourse/discourse.git
synced 2025-03-06 19:29:51 +00:00
FIX: increase host_must_be_valid regex for .technology TLD
.technology is 11 chars long and wasn't being matched previously
This commit is contained in:
parent
7389831961
commit
5f47603b07
@ -39,7 +39,7 @@ class EmbeddableHost < ActiveRecord::Base
|
|||||||
private
|
private
|
||||||
|
|
||||||
def host_must_be_valid
|
def host_must_be_valid
|
||||||
if host !~ /\A[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,7}(:[0-9]{1,5})?(\/.*)?\Z/i &&
|
if host !~ /\A[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,10}(:[0-9]{1,5})?(\/.*)?\Z/i &&
|
||||||
host !~ /\A(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})(:[0-9]{1,5})?(\/.*)?\Z/ &&
|
host !~ /\A(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})(:[0-9]{1,5})?(\/.*)?\Z/ &&
|
||||||
host !~ /\A([a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.)?localhost(\:[0-9]{1,5})?(\/.*)?\Z/i
|
host !~ /\A([a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.)?localhost(\:[0-9]{1,5})?(\/.*)?\Z/i
|
||||||
errors.add(:host, I18n.t('errors.messages.invalid'))
|
errors.add(:host, I18n.t('errors.messages.invalid'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user