| Conditions | 8 |
| Paths | 19 |
| Total Lines | 27 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public static function resolveURI($parent, $current) |
||
| 32 | { |
||
| 33 | if (false !== $pos = strpos($current, '://')) { |
||
| 34 | if (strpos($current, '/') > $pos) { |
||
| 35 | return $current; |
||
| 36 | } |
||
| 37 | } |
||
| 38 | |||
| 39 | if ($current === '') { |
||
| 40 | return $parent; |
||
| 41 | } |
||
| 42 | |||
| 43 | $result = $parent; |
||
| 44 | if ($current[0] === '#') { |
||
| 45 | if (false !== $pos = strpos($parent, '#')) { |
||
| 46 | $result = substr($parent, 0, $pos) . $current; |
||
| 47 | } |
||
| 48 | } else { |
||
| 49 | if (false !== $pos = strrpos($parent, '/')) { |
||
| 50 | $result = substr($parent, 0, $pos + 1) . $current; |
||
| 51 | } |
||
| 52 | } |
||
| 53 | if (false === strpos($result, '#')) { |
||
| 54 | $result .= '#'; |
||
| 55 | } |
||
| 56 | return $result; |
||
| 57 | } |
||
| 58 | |||
| 60 | } |