worldwide 1.11.0 → 1.11.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 201314dc59d2e10fb46c16cd4cac2ddb6a345074226567b221340660f53d6936
4
- data.tar.gz: 0acd813a2beea616bff276a474783d38f101dd6d875d24fbbc34862a7b3c1844
3
+ metadata.gz: 7b1b899bdd7349cec9a36e0468737cd103b14587aa6db1eec80199e4240f9d23
4
+ data.tar.gz: 9a6d60fed160223ada223c51781df60010a8b5b9abd44b58dbef2ccd80bf1d41
5
5
  SHA512:
6
- metadata.gz: b8d0b34eccbde7cbf76254c9ca50e21d4a1bfd93f9b0ba7a75a12532d8152378572c184fccdb6749e3ee2efa7d62d9586a904333583d293acd3f6968c1da592d
7
- data.tar.gz: cfbfeebf34e7b3c4b68d6c9c0e5da78fa1627b0fe7248a3cdc3ea74cde3292adbeab3be86c97391e56f32016de23fa357cc9c265e070fc90896f3c6782b7eb77
6
+ metadata.gz: a75e2c881aef0bb5ca318696c4e53d14f5524bb67f91737f74bc1ce1a4a30b4903656e2201f4306df463224f04809968ec622671083d1b2910c0c318614f6365
7
+ data.tar.gz: f44bbef128f4da580f363d32866752c0e1acaea9d04f85cb1113faf4a5cca37ae941581db624740870f20a955e14ffd2ebec466dc4790ee80dc3ebcc86d3a824
data/CHANGELOG.md CHANGED
@@ -26,9 +26,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
26
26
  - Security in case of vulnerabilities.
27
27
 
28
28
  ## [Unreleased]
29
-
29
+ - Nil.
30
30
  ---
31
31
 
32
+ ## [1.11.1] - 2024-10-02
33
+ - Configure regexp timeout in Worldwide#Phone [#290](https://github.com/Shopify/worldwide/pull/290)
34
+
32
35
  ## [1.11.0] - 2024-10-02
33
36
  - Add address1_regex to regions [#281](https://github.com/Shopify/worldwide/pull/281)
34
37
  - Add address1_regex for BE, CL, MX, ES, IL [#282](https://github.com/Shopify/worldwide/pull/282)
data/Gemfile.lock CHANGED
@@ -13,7 +13,7 @@ GIT
13
13
  PATH
14
14
  remote: .
15
15
  specs:
16
- worldwide (1.11.0)
16
+ worldwide (1.11.1)
17
17
  activesupport (>= 7.0)
18
18
  i18n
19
19
  phonelib (~> 0.8)
@@ -137,14 +137,19 @@ module Worldwide
137
137
  number = input.downcase
138
138
 
139
139
  ["ext", "x", ";"].each do |separator|
140
- if number.include?(separator)
141
- m = number.match(Regexp.new("(?<base>[0-9a-z +-]*)\\s*#{separator}\\.?\\s*(?<ext>.*)"))
142
- return [m["base"], m["ext"]] unless m.nil?
143
- end
140
+ next unless number.include?(separator)
141
+
142
+ m = number.match(Regexp.new(
143
+ "(?<base>[0-9a-z +-]*)\\s*#{separator}\\.?\\s*(?<ext>.*)",
144
+ timeout: 1,
145
+ ))
146
+ return [m["base"], m["ext"]] unless m.nil?
144
147
  end
145
148
 
146
149
  # If we get this far, then we have not found an extension, and assume that the full input is just a public number
147
150
  [input, nil]
151
+ rescue Regexp::TimeoutError
152
+ [input, nil]
148
153
  end
149
154
 
150
155
  # Convert exotic characters to ASCII
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Worldwide
4
- VERSION = "1.11.0"
4
+ VERSION = "1.11.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: worldwide
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.0
4
+ version: 1.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-02 00:00:00.000000000 Z
11
+ date: 2024-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -8505,7 +8505,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
8505
8505
  - !ruby/object:Gem::Version
8506
8506
  version: '0'
8507
8507
  requirements: []
8508
- rubygems_version: 3.5.20
8508
+ rubygems_version: 3.5.21
8509
8509
  signing_key:
8510
8510
  specification_version: 4
8511
8511
  summary: Internationalization and localization APIs