File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 6
6
Given a list of IP address ranges, minify that list to the smallest possible size by performing the following
7
7
optimizations:
8
8
9
- - removing duplicate IP ranges from the list
9
+ - removing invalid IP addresses/ranges from the list
10
+ - removing duplicates
10
11
- removing IP ranges already covered by larger ranges in the list
11
12
- merging adjacent IP ranges into larger, contiguous blocks
12
13
Original file line number Diff line number Diff line change @@ -34,8 +34,7 @@ protected function parseOrFail(string $cidrNotation): void
34
34
$ onlyIp = filter_var (trim ($ cidrNotation ), FILTER_VALIDATE_IP , FILTER_FLAG_IPV4 );
35
35
36
36
if ($ onlyIp ) {
37
- $ this ->prefix = $ onlyIp ;
38
- $ this ->length = 32 ;
37
+ $ this ->parseOrFail ($ onlyIp . '/32 ' );
39
38
return ;
40
39
}
41
40
You can’t perform that action at this time.
0 commit comments