Some more places ...
This commit is contained in:
parent
8a2230bc4c
commit
1d745c25a7
6 changed files with 73 additions and 42 deletions
|
@ -410,7 +410,7 @@ class Network
|
|||
$matches = [];
|
||||
$new_location_info = @parse_url($curl_info['redirect_url']);
|
||||
$old_location_info = @parse_url($curl_info['url']);
|
||||
|
||||
|
||||
preg_match('/(Location:|URI:)(.*?)\n/', $header, $matches);
|
||||
$newurl = trim(array_pop($matches));
|
||||
|
||||
|
@ -654,7 +654,7 @@ class Network
|
|||
public static function stripTrackingQueryParams($url)
|
||||
{
|
||||
$urldata = parse_url($url);
|
||||
if (is_string($urldata["query"])) {
|
||||
if (!empty($urldata["query"])) {
|
||||
$query = $urldata["query"];
|
||||
parse_str($query, $querydata);
|
||||
|
||||
|
@ -838,14 +838,35 @@ class Network
|
|||
return "";
|
||||
}
|
||||
|
||||
if (empty($parts1["scheme"])) {
|
||||
$parts1["scheme"] = '';
|
||||
}
|
||||
if (empty($parts2["scheme"])) {
|
||||
$parts2["scheme"] = '';
|
||||
}
|
||||
|
||||
if ($parts1["scheme"] != $parts2["scheme"]) {
|
||||
return "";
|
||||
}
|
||||
|
||||
if (empty($parts1["host"])) {
|
||||
$parts1["host"] = '';
|
||||
}
|
||||
if (empty($parts2["host"])) {
|
||||
$parts2["host"] = '';
|
||||
}
|
||||
|
||||
if ($parts1["host"] != $parts2["host"]) {
|
||||
return "";
|
||||
}
|
||||
|
||||
if (empty($parts1["port"])) {
|
||||
$parts1["port"] = '';
|
||||
}
|
||||
if (empty($parts2["port"])) {
|
||||
$parts2["port"] = '';
|
||||
}
|
||||
|
||||
if ($parts1["port"] != $parts2["port"]) {
|
||||
return "";
|
||||
}
|
||||
|
@ -856,6 +877,13 @@ class Network
|
|||
$match .= ":".$parts1["port"];
|
||||
}
|
||||
|
||||
if (empty($parts1["path"])) {
|
||||
$parts1["path"] = '';
|
||||
}
|
||||
if (empty($parts2["path"])) {
|
||||
$parts2["path"] = '';
|
||||
}
|
||||
|
||||
$pathparts1 = explode("/", $parts1["path"]);
|
||||
$pathparts2 = explode("/", $parts2["path"]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue