More secured getURLContent method. Add PHPUnit on getURLContent

This commit is contained in:
Laurent Destailleur
2020-10-27 18:02:05 +01:00
parent d750dc48a1
commit 80d13e711c
8 changed files with 75 additions and 13 deletions

View File

@@ -1634,7 +1634,7 @@ class Setup extends DolibarrApi
$xmlarray = getURLContent($xmlremote);
// Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...)
if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '404')
if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404')
{
$xmlfile = $xmlarray['content'];
//print "xmlfilestart".$xmlfile."endxmlfile";