Skip to content
Snippets Groups Projects

Emails without top level domain can't be submitted during registration

Closed Divyam Tayal requested to merge gitlab-community/gitlab:499244-email-val into master
1 unresolved thread
2 files
+ 2
14
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 2
3
@@ -140,11 +140,10 @@ module PathRegex
@@ -140,11 +140,10 @@ module PathRegex
FULL_NAMESPACE_FORMAT_REGEX = %r{(#{NAMESPACE_FORMAT_REGEX}/){,#{Namespace::NUMBER_OF_ANCESTORS_ALLOWED}}#{NAMESPACE_FORMAT_REGEX}}
FULL_NAMESPACE_FORMAT_REGEX = %r{(#{NAMESPACE_FORMAT_REGEX}/){,#{Namespace::NUMBER_OF_ANCESTORS_ALLOWED}}#{NAMESPACE_FORMAT_REGEX}}
# The email pattern should be compilable to a Regex with the option v. Hence the - character must be quoted.
# The email pattern should be compilable to a Regex with the option v. Hence the - character must be quoted.
LOCAL_PART_1 = '[a-zA-Z0-9]+' # First character must be a-z, A-Z or a number. We don't allow quoted emails.
LOCAL_PART = '[^"@]+' # Any character except @ and double quotes.
LOCAL_PART_2 = '([._%+\-]\w+)*' # The characters ._%+- cannot be consecutive, they must be followed by an alphanumeric character.
DOMAIN = '([a-zA-Z0-9]+([a-zA-Z0-9\-][a-zA-Z0-9]+)*\.)+' # Domain or subdomains must not start or finish with hyphen
DOMAIN = '([a-zA-Z0-9]+([a-zA-Z0-9\-][a-zA-Z0-9]+)*\.)+' # Domain or subdomains must not start or finish with hyphen
TLD = '[a-zA-Z]{2,}' # TLD
TLD = '[a-zA-Z]{2,}' # TLD
EMAIL_FORMAT_JS = LOCAL_PART_1 + LOCAL_PART_2 + '@' + DOMAIN + TLD
EMAIL_FORMAT_JS = LOCAL_PART + '@' + DOMAIN + TLD
def organization_route_regex
def organization_route_regex
@organization_route_regex ||= begin
@organization_route_regex ||= begin
Loading