| @@ 23-34 (lines=12) @@ | ||
| 20 | $pre = '(?:/(?:12[0-8]|1[0-1][0-9]|[1-9][0-9]|[0-9]))'; // /0 - /128 |
|
| 21 | ||
| 22 | // prefix check |
|
| 23 | if (strpos($aIP, '/') !== false) |
|
| 24 | { |
|
| 25 | if (preg_match('#' . $pre . '$#s', $aIP, $find)) |
|
| 26 | { |
|
| 27 | $aIP = substr($aIP, 0, 0-strlen($find[0])); |
|
| 28 | unset($find); |
|
| 29 | } |
|
| 30 | else |
|
| 31 | { |
|
| 32 | return false; |
|
| 33 | } |
|
| 34 | } |
|
| 35 | ||
| 36 | // IPv4-compatiblity check |
|
| 37 | if (preg_match('#(?<=:'.')' . $this->ip4 . '$#s', $aIP, $find)) |
|
| @@ 393-398 (lines=6) @@ | ||
| 390 | } |
|
| 391 | ||
| 392 | $url = Context::getUrl($num_args, $args_list, NULL, FALSE); |
|
| 393 | if(strncasecmp('http', $url, 4) !== 0) |
|
| 394 | { |
|
| 395 | preg_match('/^(http|https):\/\/([^\/]+)\//', $request_uri, $match); |
|
| 396 | $url = Context::getUrl($num_args, $args_list, NULL, FALSE); |
|
| 397 | return substr($match[0], 0, -1) . $url; |
|
| 398 | } |
|
| 399 | return $url; |
|
| 400 | } |
|
| 401 | ||