|
|
@@ -180,7 +180,7 @@ function RefurlCookie($gurl) |
|
|
|
*/ |
|
|
|
function GetHostInfo($gurl) |
|
|
|
{ |
|
|
|
$gurl = preg_replace("/^http:\/\//i", "", trim($gurl)); |
|
|
|
$gurl = preg_replace("/^(http|https):\/\//i", "", trim($gurl)); |
|
|
|
$garr['host'] = preg_replace("/\/(.*)$/i", "", $gurl); |
|
|
|
$garr['query'] = "/".preg_replace("/^([^\/]*)\//i", "", $gurl); |
|
|
|
return $garr; |
|
|
@@ -318,7 +318,7 @@ function FillUrl($refurl, $surl) |
|
|
|
$basehost = ((!isset($urls['port']) || $urls['port'] == '80') ? $urls['host'] : $urls['host'].':'.$urls['port']); |
|
|
|
//由于直接获得的path在处理 http://xxxx/nnn/aaa?fdsafd 这种情况时会有错误,因此用其它方式处理 |
|
|
|
$basepath = $basehost; |
|
|
|
$paths = explode('/', preg_replace("/^http:\/\//i", "", $refurl)); |
|
|
|
$paths = explode('/', preg_replace("/^(http|https):\/\//i", "", $refurl)); |
|
|
|
$n = count($paths); |
|
|
|
for ($i = 1; $i < ($n - 1); $i++) { |
|
|
|
if (!preg_match("/[\?]/", $paths[$i])) $basepath .= '/'.$paths[$i]; |
|
|
@@ -347,13 +347,13 @@ function FillUrl($refurl, $surl) |
|
|
|
} else { |
|
|
|
if (strlen($surl) < 7) { |
|
|
|
$okurl = $basepath.'/'.$surl; |
|
|
|
} else if (preg_match("/^http:\/\//i", $surl)) { |
|
|
|
} else if (preg_match("/^(http|https):\/\//i", $surl)) { |
|
|
|
$okurl = $surl; |
|
|
|
} else { |
|
|
|
$okurl = $basepath.'/'.$surl; |
|
|
|
} |
|
|
|
} |
|
|
|
$okurl = preg_replace("/^http:\/\//i", '', $okurl); |
|
|
|
$okurl = preg_replace("/^(http|https):\/\//i", '', $okurl); |
|
|
|
$okurl = 'http://'.preg_replace("/\/{1,}/", '/', $okurl); |
|
|
|
return $okurl; |
|
|
|
} |
|
|
@@ -380,7 +380,7 @@ function GetUrlFromListRule($regxurl = '', $handurl = '', $startid = 0, $endid = |
|
|
|
$handurls = explode("\n", $handurl); |
|
|
|
foreach ($handurls as $handurl) { |
|
|
|
$handurl = trim($handurl); |
|
|
|
if (preg_match("/^http:\/\//i", $handurl)) { |
|
|
|
if (preg_match("/^(http|https):\/\//i", $handurl)) { |
|
|
|
$lists[$n][0] = $handurl; |
|
|
|
$lists[$n][1] = 0; |
|
|
|
$n++; |
|
|
|