Fix whitespace
This commit is contained in:
parent
a4b7fe3b64
commit
4d684b3790
@ -340,18 +340,18 @@ function z_post_url($url,$params, $headers = null, &$redirects = 0, $timeout = 0
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($http_code == 301 || $http_code == 302 || $http_code == 303) {
|
if($http_code == 301 || $http_code == 302 || $http_code == 303) {
|
||||||
$matches = array();
|
$matches = array();
|
||||||
preg_match('/(Location:|URI:)(.*?)\n/', $header, $matches);
|
preg_match('/(Location:|URI:)(.*?)\n/', $header, $matches);
|
||||||
$newurl = trim(array_pop($matches));
|
$newurl = trim(array_pop($matches));
|
||||||
if(strpos($newurl,'/') === 0)
|
if(strpos($newurl,'/') === 0)
|
||||||
$newurl = $url . $newurl;
|
$newurl = $url . $newurl;
|
||||||
$url_parsed = @parse_url($newurl);
|
$url_parsed = @parse_url($newurl);
|
||||||
if (isset($url_parsed)) {
|
if (isset($url_parsed)) {
|
||||||
$redirects++;
|
$redirects++;
|
||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
return z_post_url($newurl,$params,$headers,$redirects,$timeout);
|
return z_post_url($newurl,$params,$headers,$redirects,$timeout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$rc = intval($http_code);
|
$rc = intval($http_code);
|
||||||
$ret['return_code'] = $rc;
|
$ret['return_code'] = $rc;
|
||||||
$ret['success'] = (($rc >= 200 && $rc <= 299) ? true : false);
|
$ret['success'] = (($rc >= 200 && $rc <= 299) ? true : false);
|
||||||
|
Reference in New Issue
Block a user