Skip to content

Commit

Permalink
fixed issue #326
Browse files Browse the repository at this point in the history
  • Loading branch information
daddyz committed Dec 15, 2024
1 parent 04c8c86 commit 4915b06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/phonelib/phone_analyzer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ module PhoneAnalyzer
# country (2 letters) like 'US', 'us' or :us for United States
def analyze(phone, passed_country)
countries = country_or_default_country passed_country

return analyze_single_country(phone, countries.first, passed_country) if countries.size == 1

results = {}
Expand Down Expand Up @@ -134,7 +133,8 @@ def detect_and_parse(phone, country)
key = data[:id]
parsed = parse_single_country(phone, data)
if (!Phonelib.strict_double_prefix_check || key == country) && double_prefix_allowed?(data, phone, parsed && parsed[key])
parsed = parse_single_country(changed_dp_phone(key, phone), data)
parsed2 = parse_single_country(changed_dp_phone(key, phone), data)
parsed = parsed2 if parsed2 && parsed2[key] && parsed2[key][:valid].size > 0
end
result.merge!(parsed) unless parsed.nil?
end.compact
Expand Down

0 comments on commit 4915b06

Please sign in to comment.