Content-Length: 296224 | pFad | http://github.com/alcohol/iso3166/pull/114

99 improve/fallback country-lookup (again) by xerc · Pull Request #114 · alcohol/iso3166 · GitHub
Skip to content

improve/fallback country-lookup (again) #114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

xerc
Copy link
Contributor

@xerc xerc commented Mar 7, 2025

'France (European Territory)' => 'France'

@codecov-commenter
Copy link

codecov-commenter commented Mar 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@38a9ead). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff            @@
##             main      #114   +/-   ##
========================================
  Coverage        ?   100.00%           
  Complexity      ?        40           
========================================
  Files           ?         4           
  Lines           ?       102           
  Branches        ?         0           
========================================
  Hits            ?       102           
  Misses          ?         0           
  Partials        ?         0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jhoff
Copy link

jhoff commented Jun 4, 2025

Not really related to this specific change, but this logic block has a bug that was introduced in d9e9584. When an empty string is passed for $value it'll return the first country in the list ( Afghanistan ) because the string length is 0, making mb_substr('', 0, 0) true.

Seems like a handful of tests would help to make sure that these lookups are working like they should.

@xerc
Copy link
Contributor Author

xerc commented Jun 4, 2025

Not really related to this specific change, but this logic block has a bug that was introduced in d9e9584

fyi/ strcasecmp is not used anymore

@xerc xerc force-pushed the main branch 2 times, most recently from 858bf79 to d90446a Compare June 4, 2025 17:13
@jhoff
Copy link

jhoff commented Jun 4, 2025

fyi/ strcasecmp is not used anymore

Correct, though it was actually strncasecmp which was taking the length of 0 as the third argument. This usage was refactored to use mb_substr instead, but the bug was the same in both cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/alcohol/iso3166/pull/114

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy