| Conditions | 3 |
| Paths | 4 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 38 | public function clean($input) |
||
| 39 | { |
||
| 40 | $bits = explode('://', $input); |
||
| 41 | if (count($bits) > 1) { |
||
| 42 | $protocol = $bits[0]; |
||
| 43 | unset($bits[0]); |
||
| 44 | } else { |
||
| 45 | $protocol = self::DEFAULT_PROTOCOL; |
||
| 46 | } |
||
| 47 | $url = implode($bits); |
||
| 48 | $bits = explode('?', $url); |
||
| 49 | if (substr($bits[0], -1) != '/') { |
||
| 50 | $bits[0] .= '/'; |
||
| 51 | } |
||
| 52 | return $protocol . '://' . implode('?', $bits); |
||
| 53 | } |
||
| 54 | } |
||
| 55 |