Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
21 | public function __construct(array $seeds, $allowSubDomains = false) |
||
22 | { |
||
23 | $this->allowSubDomains = $allowSubDomains; |
||
24 | |||
25 | foreach ($seeds as $seed) { |
||
26 | $hostname = parse_url($seed, PHP_URL_HOST); |
||
27 | |||
28 | if ($this->allowSubDomains) { |
||
29 | // only use hostname.tld for comparison |
||
30 | $this->allowedHosts[] = join('.', array_slice(explode('.', $hostname), -2)); |
||
31 | } else { |
||
32 | // user entire *.hostname.tld for comparison |
||
33 | $this->allowedHosts[] = $hostname; |
||
34 | } |
||
50 |