lib/homograph_detector.rb
def homograph_attack?
    # If we can't determine the Unicode Scripts for the domain, return false
    return false if domain_scripts.nil?

    # If the combination of Unicode Scripts used in the domain are ones we have
    # whitelisted, return false
    return false if domain_has_approved_combination_of_scripts?

    # If the combination of Unicode Scripts in the domain are problematic,
    # return true
    return true if domain_has_sketchy_combination_of_scripts?

    # If the domain is entirely composed of Cyrillic characters and each
    # character can be confusable with a Latin character, return true
    return true if domain_has_confusable_cyrillic_chars?

    false
  end
# Unicode Script names returned by the 'unicode-scripts' gem
Unicode Script names returned by the 'unicode-scripts' gem
Unicode Script names returned by the ' unicode - scripts ' gem
def homograph_attack?
    return false if domain_scripts.nil?
    return false if domain_has_approved_combination_of_scripts?
    return true if domain_has_sketchy_combination_of_scripts?
    return true if domain_has_confusable_cyrillic_chars?
    false
  end
def homograph_attack? return false if domain_scripts . nil? return false if domain_has_approved_combination_of_scripts? return true if domain_has_sketchy_combination_of_scripts? return true if domain_has_confusable_cyrillic_chars? false end
Unicode Script names returned by the 'unicode-scripts' gem
Unicode Script names returned by the ' unicode - scripts ' gem
# If we can't determine the Unicode Scripts for the domain, return false # If the combination of Unicode Scripts used in the domain are ones we have # whitelisted, return false # If the combination of Unicode Scripts in the domain are problematic, # return true # If the domain is entirely composed of Cyrillic characters and each # character can be confusable with a Latin character, return true