Skip to content

Commit b3362a3

Browse files
authored
Merge pull request #668 from giggsey/upstream-8.13.53
Upstream changes from Google for v8.13.53
2 parents cc9a82b + e8f3a15 commit b3362a3

23 files changed

+99
-83
lines changed

METADATA-VERSION.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# It can be a commit, branch or tag of the https://github.com/google/libphonenumber project
33
#
44
# For more information, look at the phing tasks in build.xml
5-
v8.13.52
5+
v8.13.53

src/PhoneNumberUtil.php

+16
Original file line numberDiff line numberDiff line change
@@ -2776,6 +2776,9 @@ public function formatOutOfCountryKeepingAlphaChars(PhoneNumber $number, $region
27762776
$regionCode = $this->getRegionCodeForCountryCode($countryCode);
27772777
// Metadata cannot be null because the country calling code is valid.
27782778
$metadataForRegion = $this->getMetadataForRegionOrCallingCode($countryCode, $regionCode);
2779+
// Strip any extension
2780+
$this->maybeStripExtension($formattedNumber);
2781+
// Append the formatted extension
27792782
$this->maybeAppendFormattedExtension(
27802783
$number,
27812784
$metadataForRegion,
@@ -3675,6 +3678,13 @@ public function isPossibleNumber($number, $regionDialingFrom = null)
36753678
* length (obviously includes the length of area codes for fixed line numbers), it will
36763679
* return false for the subscriber-number-only version.
36773680
* </ol>
3681+
*
3682+
* There is a known <a href="https://issuetracker.google.com/issues/335892662">issue</a> with this
3683+
* method: if a number is possible only in a certain region among several regions that share the
3684+
* same country calling code, this method will consider only the "main" region. For example,
3685+
* +1310xxxx are valid numbers in Canada. However, they are not possible in the US. As a result,
3686+
* this method will return IS_POSSIBLE_LOCAL_ONLY for +1310xxxx.
3687+
*
36783688
* @param PhoneNumber $number the number that needs to be checked
36793689
* @return int a ValidationResult object which indicates whether the number is possible
36803690
*/
@@ -3705,6 +3715,12 @@ public function isPossibleNumberWithReason(PhoneNumber $number)
37053715
* return false for the subscriber-number-only version.
37063716
* </ol>
37073717
*
3718+
* There is a known <a href="https://issuetracker.google.com/issues/335892662">issue</a> with this
3719+
* method: if a number is possible only in a certain region among several regions that share the
3720+
* same country calling code, this method will consider only the "main" region. For example,
3721+
* +1310xxxx are valid numbers in Canada. However, they are not possible in the US. As a result,
3722+
* this method will return IS_POSSIBLE_LOCAL_ONLY for +1310xxxx.
3723+
*
37083724
* @param PhoneNumber $number the number that needs to be checked
37093725
* @param int $type the PhoneNumberType we are interested in
37103726
* @return int a ValidationResult object which indicates whether the number is possible

src/carrier/data/en/212.php

+29-29
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@
1414
return [
1515
21260 => 'Inwi',
1616
21261 => 'Maroc Telecom',
17-
212612 => 'Méditel',
18-
212614 => 'Méditel',
19-
212617 => 'Méditel',
20-
212619 => 'Méditel',
21-
212620 => 'Méditel',
22-
212621 => 'Méditel',
17+
212612 => 'Orange',
18+
212614 => 'Orange',
19+
212617 => 'Orange',
20+
212619 => 'Orange',
21+
212620 => 'Orange',
22+
212621 => 'Orange',
2323
212622 => 'Maroc Telecom',
2424
212623 => 'Maroc Telecom',
2525
212624 => 'Maroc Telecom',
26-
212625 => 'Méditel',
26+
212625 => 'Orange',
2727
212626 => 'Inwi',
2828
212627 => 'Inwi',
2929
212628 => 'Maroc Telecom',
3030
212629 => 'Inwi',
3131
212630 => 'Inwi',
32-
212631 => 'Méditel',
33-
212632 => 'Méditel',
32+
212631 => 'Orange',
33+
212632 => 'Orange',
3434
212633 => 'Inwi',
3535
212634 => 'Inwi',
3636
212635 => 'Inwi',
@@ -42,42 +42,42 @@
4242
212641 => 'Maroc Telecom',
4343
212642 => 'Maroc Telecom',
4444
212643 => 'Maroc Telecom',
45-
212644 => 'Méditel',
46-
212645 => 'Méditel',
45+
212644 => 'Orange',
46+
212645 => 'Orange',
4747
212646 => 'Inwi',
4848
212647 => 'Inwi',
4949
212648 => 'Maroc Telecom',
50-
212649 => 'Méditel',
50+
212649 => 'Orange',
5151
21265 => 'Maroc Telecom',
52-
212656 => 'Méditel',
53-
212657 => 'Méditel',
54-
212660 => 'Méditel',
52+
212656 => 'Orange',
53+
212657 => 'Orange',
54+
212660 => 'Orange',
5555
212661 => 'Maroc Telecom',
5656
212662 => 'Maroc Telecom',
57-
212663 => 'Méditel',
58-
212664 => 'Méditel',
59-
212665 => 'Méditel',
57+
212663 => 'Orange',
58+
212664 => 'Orange',
59+
212665 => 'Orange',
6060
212666 => 'Maroc Telecom',
6161
212667 => 'Maroc Telecom',
6262
212668 => 'Maroc Telecom',
63-
212669 => 'Méditel',
63+
212669 => 'Orange',
6464
21267 => 'Maroc Telecom',
65-
212674 => 'Méditel',
66-
212675 => 'Méditel',
67-
212679 => 'Méditel',
65+
212674 => 'Orange',
66+
212675 => 'Orange',
67+
212679 => 'Orange',
6868
212680 => 'Inwi',
6969
212681 => 'Inwi',
7070
212682 => 'Maroc Telecom',
71-
212684 => 'Méditel',
71+
212684 => 'Orange',
7272
212687 => 'Inwi',
73-
212688 => 'Méditel',
73+
212688 => 'Orange',
7474
212689 => 'Maroc Telecom',
7575
212690 => 'Inwi',
76-
212691 => 'Méditel',
76+
212691 => 'Orange',
7777
2126921 => 'Al Hourria Telecom',
7878
2126922 => 'Al Hourria Telecom',
79-
212693 => 'Méditel',
80-
212694 => 'Méditel',
79+
212693 => 'Orange',
80+
212694 => 'Orange',
8181
212695 => 'Inwi',
8282
212696 => 'Maroc Telecom',
8383
212697 => 'Maroc Telecom',
@@ -88,6 +88,6 @@
8888
21272 => 'Inwi',
8989
21275 => 'Maroc Telecom',
9090
21276 => 'Maroc Telecom',
91-
21277 => 'Méditel',
92-
21278 => 'Méditel',
91+
21277 => 'Orange',
92+
21278 => 'Orange',
9393
];

src/carrier/data/en/229.php

+1-7
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,10 @@
1212
*/
1313

1414
return [
15-
2290140 => 'SBIN',
16-
2290141 => 'SBIN',
15+
229014 => 'SBIN',
1716
2290142 => 'MTN',
18-
2290143 => 'SBIN',
19-
2290144 => 'SBIN',
2017
2290145 => 'Moov',
2118
2290146 => 'MTN',
22-
2290147 => 'SBIN',
23-
2290148 => 'SBIN',
2419
229015 => 'MTN',
2520
2290155 => 'Moov',
2621
2290158 => 'Moov',
@@ -47,7 +42,6 @@
4742
22946 => 'MTN',
4843
2295 => 'MTN',
4944
22955 => 'Moov',
50-
22956 => 'Moov',
5145
22960 => 'Moov',
5246
22961 => 'MTN',
5347
22962 => 'MTN',

src/carrier/data/en/252.php

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
25270 => 'Golis Telecom',
3232
25271 => 'Amtel',
3333
25272 => 'Golis Telecom',
34+
25276 => 'Somtel',
3435
25279 => 'Somtel',
3536
25280 => 'Somali Networks',
3637
25288 => 'Somali Networks',

src/carrier/data/en/351.php

+2
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
3519280 => 'NOWO',
5858
3519281 => 'NOWO',
5959
3519282 => 'Digi Communications',
60+
3519283 => 'Digi Communications',
61+
3519284 => 'Digi Communications',
6062
3519285 => 'ONITELECOM',
6163
3519290 => 'NOS',
6264
3519291 => 'NOS',

src/carrier/data/en/371.php

+11-22
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,23 @@
1313

1414
return [
1515
371200 => 'Tele2',
16-
3712010 => 'Bite Latvia',
17-
3712011 => 'Bite Latvia',
18-
3712012 => 'Bite Latvia',
19-
3712013 => 'Bite Latvia',
20-
3712014 => 'Bite Latvia',
21-
3712015 => 'Bite Latvia',
22-
3712016 => 'Bite Latvia',
23-
3712017 => 'Bite Latvia',
24-
3712019 => 'Bite Latvia',
16+
371201 => 'Bite Latvia',
17+
3712018 => 'Tele2',
2518
371202 => 'LMT',
2619
371203 => 'Tele2',
2720
371204 => 'Tele2',
2821
371205 => 'Tele2',
2922
371206 => 'Bite Latvia',
3023
371207 => 'Bite Latvia',
31-
3712080 => 'Bite Latvia',
32-
3712081 => 'Bite Latvia',
33-
3712082 => 'Bite Latvia',
34-
3712083 => 'Bite Latvia',
35-
3712084 => 'Bite Latvia',
36-
3712085 => 'Bite Latvia',
37-
3712086 => 'Bite Latvia',
38-
3712087 => 'Bite Latvia',
39-
3712088 => 'Bite Latvia',
24+
371208 => 'Bite Latvia',
25+
3712089 => 'Tele2',
26+
3712091 => 'Tele2',
27+
3712092 => 'Tele2',
28+
3712093 => 'Tele2',
4029
3712094 => 'Triatel',
30+
3712095 => 'Tele2',
31+
3712096 => 'Tele2',
32+
3712097 => 'Tele2',
4133
37121 => 'Bite Latvia',
4234
3712200 => 'LMT',
4335
3712201 => 'LMT',
@@ -75,10 +67,7 @@
7567
3712317 => 'Bite Latvia',
7668
3712320 => 'Bite Latvia',
7769
3712322 => 'Bite Latvia',
78-
37123230 => 'Tele2',
79-
37123232 => 'Tele2',
80-
37123233 => 'Tele2',
81-
37123238 => 'Tele2',
70+
3712323 => 'Tele2',
8271
3712327 => 'Bite Latvia',
8372
3712328 => 'LMT',
8473
3712330 => 'Bite Latvia',

src/carrier/data/en/389.php

-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
38972 => 'T-Mobile',
1818
38973 => 'A1',
1919
389736 => 'T-Mobile',
20-
3897370 => 'T-Mobile',
21-
3897371 => 'T-Mobile',
2220
389742 => 'T-Mobile',
2321
3897421 => 'Mobik',
2422
389746 => 'T-Mobile',

src/carrier/data/en/597.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@
1717
59774 => 'Digicel',
1818
59775 => 'Telesur',
1919
59776 => 'Digicel',
20-
597770 => 'Telesur',
21-
597771 => 'Telesur',
22-
597772 => 'Telesur',
23-
597773 => 'Telesur',
24-
597774 => 'Telesur',
20+
59777 => 'Telesur',
2521
5978 => 'Telesur',
2622
59781 => 'Digicel',
2723
59782 => 'Digicel',

src/carrier/data/en/680.php

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
68045 => 'PMCI',
1616
68046 => 'PMCI',
1717
68077 => 'PalauCel',
18+
68078 => 'PalauCel',
1819
68083 => 'PMCI',
1920
68088 => 'PalauTel',
2021
];

src/carrier/data/en/90.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
90510221 => 'Netgsm',
1919
90510222 => 'Netgsm',
2020
90510223 => 'Netgsm',
21+
90510224 => 'Netgsm',
2122
90510227 => 'Netgsm',
2223
90510232 => 'Foniv Telecommunications Services',
2324
90510244 => 'Nida Telekomunikasyon',
@@ -39,10 +40,6 @@
3940
9053386 => 'Kuzey Kibris Turkcell',
4041
9053387 => 'Kuzey Kibris Turkcell',
4142
9054 => 'Vodafone',
42-
9054285 => 'KKTC Telsim',
43-
9054286 => 'KKTC Telsim',
44-
9054287 => 'KKTC Telsim',
45-
9054288 => 'KKTC Telsim',
4643
9055 => 'Turk Telekom',
4744
905610 => 'Selam Mobile',
4845
905616 => 'Turkcell',

src/carrier/data/en/92.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
*/
1313

1414
return [
15-
9230 => 'Mobilink',
15+
9230 => 'Jazz',
1616
9231 => 'Zong',
17-
9232 => 'Warid',
17+
9232 => 'Jazz',
1818
9233 => 'Ufone',
1919
9234 => 'Telenor',
2020
9235 => 'Special Communications Organization',

src/data/PhoneNumberMetadata_EH.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
'PossibleLengthLocalOnly' => [],
2323
],
2424
'mobile' => [
25-
'NationalNumberPattern' => '(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-4]|5[01]|8[0-3]))\\d{6}',
25+
'NationalNumberPattern' => '(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-467]|5[0-3]|8[0-5]))\\d{6}',
2626
'ExampleNumber' => '650123456',
2727
'PossibleLength' => [],
2828
'PossibleLengthLocalOnly' => [],

src/data/PhoneNumberMetadata_IL.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
'PossibleLengthLocalOnly' => [],
7474
],
7575
'voip' => [
76-
'NationalNumberPattern' => '7(?:38(?:0\\d|5[0-2569]|88)|8(?:33|55|77|81)\\d)\\d{4}|7(?:18|2[23]|3[237]|47|6[258]|7\\d|82|9[2-9])\\d{6}',
76+
'NationalNumberPattern' => '7(?:38(?:0\\d|5[0-3569]|88)|8(?:33|55|77|81)\\d)\\d{4}|7(?:18|2[23]|3[237]|47|6[258]|7\\d|82|9[2-9])\\d{6}',
7777
'ExampleNumber' => '771234567',
7878
'PossibleLength' => [
7979
9,

src/data/PhoneNumberMetadata_LV.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
'PossibleLengthLocalOnly' => [],
2323
],
2424
'mobile' => [
25-
'NationalNumberPattern' => '23(?:23[0-57-9]|33[0238])\\d{3}|2(?:[0-24-9]\\d\\d|3(?:0[07]|[14-9]\\d|2[024-9]|3[0-24-9]))\\d{4}',
25+
'NationalNumberPattern' => '2333[0-8]\\d{3}|2(?:[0-24-9]\\d\\d|3(?:0[07]|[14-9]\\d|2[02-9]|3[0-24-9]))\\d{4}',
2626
'ExampleNumber' => '21234567',
2727
'PossibleLength' => [],
2828
'PossibleLengthLocalOnly' => [],

src/data/PhoneNumberMetadata_MA.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
'PossibleLengthLocalOnly' => [],
2323
],
2424
'mobile' => [
25-
'NationalNumberPattern' => '(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-4]|5[01]|8[0-3]))\\d{6}',
25+
'NationalNumberPattern' => '(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-467]|5[0-3]|8[0-5]))\\d{6}',
2626
'ExampleNumber' => '650123456',
2727
'PossibleLength' => [],
2828
'PossibleLengthLocalOnly' => [],

src/data/PhoneNumberMetadata_MK.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
],
2929
],
3030
'mobile' => [
31-
'NationalNumberPattern' => '7(?:3555|(?:474|9[019]7)7)\\d{3}|7(?:[0-25-8]\\d\\d|3(?:[1-48]\\d|6[01]|7[01578])|4(?:2\\d|60|7[01578])|9(?:[2-4]\\d|5[01]|7[015]))\\d{4}',
31+
'NationalNumberPattern' => '7(?:3555|(?:474|9[019]7)7)\\d{3}|7(?:[0-25-8]\\d\\d|3(?:[1-478]\\d|6[01])|4(?:2\\d|60|7[01578])|9(?:[2-4]\\d|5[01]|7[015]))\\d{4}',
3232
'ExampleNumber' => '72345678',
3333
'PossibleLength' => [],
3434
'PossibleLengthLocalOnly' => [],

src/data/PhoneNumberMetadata_MM.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
'PossibleLengthLocalOnly' => [],
7373
],
7474
'voip' => [
75-
'NationalNumberPattern' => '1333\\d{4}|[12]468\\d{4}',
75+
'NationalNumberPattern' => '1333\\d{4}',
7676
'ExampleNumber' => '13331234',
7777
'PossibleLength' => [
7878
8,

src/data/PhoneNumberMetadata_MU.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
'PossibleLengthLocalOnly' => [],
1919
],
2020
'fixedLine' => [
21-
'NationalNumberPattern' => '(?:2(?:[0346-8]\\d|1[0-7])|4(?:[013568]\\d|2[4-8]|71)|54(?:[3-5]\\d|71)|6\\d\\d|8(?:14|3[129]))\\d{4}',
21+
'NationalNumberPattern' => '(?:2(?:[0346-8]\\d|1[0-7])|4(?:[013568]\\d|2[4-8]|71|90)|54(?:[3-5]\\d|71)|6\\d\\d|8(?:14|3[129]))\\d{4}',
2222
'ExampleNumber' => '54480123',
2323
'PossibleLength' => [
2424
7,

src/data/PhoneNumberMetadata_PW.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
'PossibleLengthLocalOnly' => [],
2323
],
2424
'mobile' => [
25-
'NationalNumberPattern' => '(?:(?:46|83)[0-5]|6[2-4689]0)\\d{4}|(?:45|77|88)\\d{5}',
25+
'NationalNumberPattern' => '(?:(?:46|83)[0-5]|(?:6[2-4689]|78)0)\\d{4}|(?:45|77|88)\\d{5}',
2626
'ExampleNumber' => '6201234',
2727
'PossibleLength' => [],
2828
'PossibleLengthLocalOnly' => [],

src/data/PhoneNumberMetadata_SO.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
'PossibleLengthLocalOnly' => [],
2929
],
3030
'mobile' => [
31-
'NationalNumberPattern' => '(?:(?:15|(?:3[59]|4[89]|6\\d|7[79]|8[08])\\d|9(?:0\\d|[2-9]))\\d|2(?:4\\d|8))\\d{5}|(?:[67]\\d\\d|904)\\d{5}',
31+
'NationalNumberPattern' => '(?:(?:15|(?:3[59]|4[89]|6\\d|7[679]|8[08])\\d|9(?:0\\d|[2-9]))\\d|2(?:4\\d|8))\\d{5}|(?:[67]\\d\\d|904)\\d{5}',
3232
'ExampleNumber' => '71123456',
3333
'PossibleLength' => [
3434
7,
@@ -152,7 +152,7 @@
152152
'pattern' => '(\\d{2})(\\d{5,7})',
153153
'format' => '$1 $2',
154154
'leadingDigitsPatterns' => [
155-
'1|28|6[0-35-9]|77|9[2-9]',
155+
'1|28|6[0-35-9]|7[67]|9[2-9]',
156156
],
157157
'nationalPrefixFormattingRule' => '',
158158
'domesticCarrierCodeFormattingRule' => '',

0 commit comments

Comments
 (0)