You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 21, 2018. It is now read-only.
In the function private function getRegionCodeForNumberFromRegionList in PhoneNumberUtil.php
$metadata = $this->getMetadataForRegion($regionCode);
returns null for $regionCode = 'US';
Changing the code in
private function init($filePrefix) {
to
$idx_region_code_non_geo_entity = array_search(self::REGION_CODE_FOR_NON_GEO_ENTITY, $this->supportedRegions);
if (FALSE !== $idx_region_code_non_geo_entity)
unset($this->supportedRegions[array_search(self::REGION_CODE_FOR_NON_GEO_ENTITY, $this->supportedRegions)]);
to avoid removing US from $this->supportedRegions in case of a failed array_search for self::REGION_CODE_FOR_NON_GEO_ENTITY solved it for me
The text was updated successfully, but these errors were encountered:
ajayrungta
pushed a commit
to ajayrungta/libphonenumber-for-PHP
that referenced
this issue
May 25, 2012
@burki, I have the same issue and I don't understand what you did to fix it (maybe it's because the function has changed from 10 months ago).
Could it be that this library doesn't support any US numbers at the moment??
Sorry if I'm too newb.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi
In the function private function getRegionCodeForNumberFromRegionList in PhoneNumberUtil.php
$metadata = $this->getMetadataForRegion($regionCode);
returns null for $regionCode = 'US';
Changing the code in
private function init($filePrefix) {
to
$idx_region_code_non_geo_entity = array_search(self::REGION_CODE_FOR_NON_GEO_ENTITY, $this->supportedRegions);
if (FALSE !== $idx_region_code_non_geo_entity)
unset($this->supportedRegions[array_search(self::REGION_CODE_FOR_NON_GEO_ENTITY, $this->supportedRegions)]);
to avoid removing US from $this->supportedRegions in case of a failed array_search for self::REGION_CODE_FOR_NON_GEO_ENTITY solved it for me
The text was updated successfully, but these errors were encountered: