@@ 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)) |
@@ 396-401 (lines=6) @@ | ||
393 | } |
|
394 | ||
395 | $url = Context::getUrl($num_args, $args_list, NULL, FALSE); |
|
396 | if(strncasecmp('http', $url, 4) !== 0) |
|
397 | { |
|
398 | preg_match('/^(http|https):\/\/([^\/]+)\//', $request_uri, $match); |
|
399 | $url = Context::getUrl($num_args, $args_list, NULL, FALSE); |
|
400 | return substr($match[0], 0, -1) . $url; |
|
401 | } |
|
402 | return $url; |
|
403 | } |
|
404 |