Skip to content

Commit

Permalink
fix email check
Browse files Browse the repository at this point in the history
  • Loading branch information
tycooon committed Oct 26, 2024
1 parent 2c01f35 commit 8010620
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions lib/umbrellio_utils/checks.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# frozen_string_literal: true

require "uri/mailto"

module UmbrellioUtils
module Checks
extend self

EMAIL_REGEXP = /\A([\w+-].?)+@[a-z\d-]+(\.[a-z]+)*\.[a-z]+\z/i
HOLDER_NAME_REGEXP = /\A([A-Za-z0-9.'-]+ ?)+\z/

def secure_compare(src, dest)
Expand All @@ -30,11 +31,11 @@ def valid_card?(number)
end

def valid_email?(email)
email.to_s =~ EMAIL_REGEXP
email.to_s.match?(URI::MailTo::EMAIL_REGEXP)
end

def valid_card_holder?(holder)
holder.to_s =~ HOLDER_NAME_REGEXP
holder.to_s.match?(HOLDER_NAME_REGEXP)
end

def valid_card_cvv?(cvv)
Expand Down
2 changes: 1 addition & 1 deletion lib/umbrellio_utils/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module UmbrellioUtils
VERSION = "1.5.1"
VERSION = "1.5.2"
end

0 comments on commit 8010620

Please sign in to comment.