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
+ 6
0
@@ -139,6 +139,12 @@ module PathRegex
@@ -139,6 +139,12 @@ module PathRegex
PROJECT_PATH_FORMAT_REGEX = /(?:#{PATH_REGEX_STR})#{NO_SUFFIX_REGEX}/
PROJECT_PATH_FORMAT_REGEX = /(?:#{PATH_REGEX_STR})#{NO_SUFFIX_REGEX}/
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.
 
LOCAL_PART = '[^"@]+' # Any character except @ and double quotes.
 
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
 
EMAIL_FORMAT_JS = LOCAL_PART + '@' + DOMAIN + TLD
 
def organization_route_regex
def organization_route_regex
@organization_route_regex ||= begin
@organization_route_regex ||= begin
illegal_words = Regexp.new(Regexp.union(ILLEGAL_ORGANIZATION_PATH_WORDS).source, Regexp::IGNORECASE)
illegal_words = Regexp.new(Regexp.union(ILLEGAL_ORGANIZATION_PATH_WORDS).source, Regexp::IGNORECASE)
Loading