| Conditions | 4 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4.0218 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 53 | public function setTargetUrl($url) |
|
| 19 | { |
||
| 20 | 53 | if ( substr($url, 0, 1) != "/" |
|
| 21 | 53 | && !preg_match('|^https?://|', $url)) { |
|
| 22 | 29 | $prefix = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX); |
|
| 23 | 29 | if ($prefix == '') { |
|
| 24 | $prefix = '/'; |
||
| 25 | } |
||
| 26 | 29 | $url = $prefix . $url; |
|
| 27 | 29 | debug_add("This is a relative URL from the local site, prepending anchor prefix: {$url}"); |
|
| 28 | } |
||
| 29 | 53 | return parent::setTargetUrl($url); |
|
| 30 | } |
||
| 43 |