Conditions | 4 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
24 | public function filterCdn($cdn = '') |
||
25 | { |
||
26 | if (!empty($cdn) && $cdn != '/') { |
||
27 | $url = parse_url($cdn); |
||
28 | if (!empty($url['host'])) { |
||
29 | $cdn = $url['host']; |
||
30 | } else { |
||
31 | $cdn = current( |
||
32 | array_filter(preg_split('/[^a-z0-9\.]+/', $url['path'])) |
||
33 | ); |
||
34 | } |
||
35 | $cdn = '//' . $cdn; |
||
36 | } else { |
||
37 | $cdn = ''; |
||
38 | } |
||
39 | |||
40 | return $cdn; |
||
41 | } |
||
42 | } |