Repository navigation
Conversation
The bundled file dates from 2022. Replace it with the current IP2Location ISO 3166-2 subdivision code release (September 2026) from https://www.ip2location.com/free/iso3166-2, unchanged except for line endings (LF, like the existing file). Among other updates this adds the four Indonesian provinces created in 2022 (ID-PD, ID-PE, ID-PS, ID-PT), so Region::getRegionCode() returns a code for them. Add a test for that.
FSA-G
force-pushed
the
update-iso3166-2
branch
from
November 28, 2026 15:44
bb1d1d3 to
179b8fd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
data/IP2LOCATION-ISO3166-2.CSVhasn't changed since theRegionclass was added in 2022. This replaces it with the current release from https://www.ip2location.com/free/iso3166-2 (the zip is dated September 2026). The file is the published CSV unchanged, except that it has LF line endings like the existing file.Among other updates, the new file has the four Indonesian provinces created in 2022, so
Region::getRegionCode('ID', 'Papua Selatan')now returnsID-PSinstead ofnull. Other countries change too, e.g. Kazakhstan, Uganda, Nepal and Ethiopia. All of these come from the published release.A new test in
tests/RegionTest.phpchecks the Indonesian codes. It fails with the old file and passes with the new one. The existingUS-CAtest still passes. The PHP deprecation PHPUnit reports (fgetcsv(): the $escape parameter must be provided,src/Region.php:74) is unrelated to this change and also happens onmaster.Two things in the published file itself, in case you want to fix them in the release:
"ID","Papua Pengunungan","ID-PE"should be Papua Pegunungan.ID-PPand MalukuID-ML. In ISO 3166-2:ID, those are the codes of the Papua and Maluku geographical units. The provinces areID-PAandID-MA.I didn't change either here, so the file stays identical to your release.