Fix #18922 : multicurrency sync in http with good currencylayer url

This commit is contained in:
Maxime Kohlhaas 2021-10-23 23:42:06 +02:00
parent c75db78cea
commit 77c716565e

View File

@ -643,13 +643,12 @@ class MultiCurrency extends CommonObject
include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
$urlendpoint = 'http://apilayer.net/api/live?access_key='.$key; $urlendpoint = 'http://api.currencylayer.com/live?access_key='.$key;
//$urlendpoint.='&format=1'; $urlendpoint .= '&source=' . (empty($conf->global->MULTICURRENCY_APP_SOURCE) ? 'USD' : $conf->global->MULTICURRENCY_APP_SOURCE);
$urlendpoint .= (empty($conf->global->MULTICURRENCY_APP_SOURCE) ? '' : '&source='.$conf->global->MULTICURRENCY_APP_SOURCE);
dol_syslog("Call url endpoint ".$urlendpoint); dol_syslog("Call url endpoint ".$urlendpoint);
$resget = getURLContent($urlendpoint, 'GET', '', 1, array(), array('http', 'https'), 1); $resget = getURLContent($urlendpoint);
if ($resget['content']) { if ($resget['content']) {
$response = $resget['content']; $response = $resget['content'];