| Conditions | 4 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | public function filterCdn($cdn = '') { |
||
| 45 | if (!empty($cdn) && $cdn != '/') { |
||
| 46 | $url = parse_url($cdn); |
||
| 47 | if (!empty($url['host'])) { |
||
| 48 | $cdn = $url['host']; |
||
| 49 | } else { |
||
| 50 | $cdn = current( |
||
| 51 | array_filter(preg_split('/[^a-z0-9\.]+/', $url['path'])) |
||
| 52 | ); |
||
| 53 | } |
||
| 54 | $cdn = '//' . $cdn; |
||
| 55 | } else { |
||
| 56 | $cdn = ''; |
||
| 57 | } |
||
| 58 | return $cdn; |
||
| 59 | } |
||
| 60 | |||
| 62 |