Merge pull request #19167 from atm-maxime/fix_currency_sync

Fix #18922 : multicurrency sync in http with good currencylayer url
This commit is contained in:
Laurent Destailleur 2021-10-24 00:44:19 +02:00 committed by GitHub
commit 66a732c005
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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