Conditions | 4 |
Paths | 3 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | $urlParts = parse_url($prefix); |
||
24 | |||
25 | // Since PHP 5.4.7 parse_url will return host when url scheme is ommited. |
||
26 | // This allows urls like //static.example.com to be used |
||
27 | if (isset($urlParts['scheme']) || isset($urlParts['host'])) { |
||
28 | $prefix = rtrim($prefix, '/') . '/'; |
||
29 | } else { |
||
30 | $prefix = '/' . trim($prefix, '/') . '/'; |
||
31 | } |
||
32 | } |
||
33 | |||
34 | return $prefix; |
||
35 | } |
||
36 | } |
||
37 |