Use all param of getURLContent
This commit is contained in:
parent
1e1b963ca7
commit
6c4f5b851d
@ -158,7 +158,7 @@ if (GETPOST('target') == 'local') {
|
||||
}
|
||||
}
|
||||
if (GETPOST('target') == 'remote') {
|
||||
$xmlarray = getURLContent($xmlremote);
|
||||
$xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only
|
||||
|
||||
// Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...)
|
||||
if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') {
|
||||
|
||||
@ -190,6 +190,7 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation =
|
||||
|
||||
$info = curl_getinfo($ch); // Reading of request must be done after sending request
|
||||
$http_code = $info['http_code'];
|
||||
|
||||
if ($followlocation && ($http_code == 301 || $http_code == 302 || $http_code == 303 || $http_code == 307)) {
|
||||
$newUrl = $info['redirect_url'];
|
||||
$maxRedirection--;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user