From ec2f4146c35e2e24b6e4c5cf7aaddc2e67b43ecc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Feb 2026 13:49:09 +0100 Subject: [PATCH] FIX Doc and log --- htdocs/core/lib/geturl.lib.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/core/lib/geturl.lib.php b/htdocs/core/lib/geturl.lib.php index 0ae26918a4f..73b722b73f8 100644 --- a/htdocs/core/lib/geturl.lib.php +++ b/htdocs/core/lib/geturl.lib.php @@ -32,17 +32,17 @@ * * You can enable constant MAIN_CURL_DEBUG to get detail of output/input into dolibarr_curl.log file. * - * @param string $url URL to call. + * @param string $url URL to call. * @param 'POST'|'GET'|'HEAD'|'PUT'|'PATCH'|'PUTALREADYFORMATED'|'POSTALREADYFORMATED'|'PATCHALREADYFORMATED'|'DELETE' $postorget 'POST', 'GET', 'HEAD', 'PUT', 'PATCH', 'PUTALREADYFORMATED', 'POSTALREADYFORMATED', 'PATCHALREADYFORMATED', 'DELETE' - * @param string $param Parameters of URL (x=value1&y=value2) or may be a formatted content with $postorget='PUTALREADYFORMATED' - * @param int<0,1> $followlocation 0=Do not follow, 1=Follow location. - * @param string[] $addheaders Array of string to add into header. Example: ('Accept: application/xrds+xml', ....) - * @param string[] $allowedschemes List of schemes that are allowed ('http' + 'https' only by default) - * @param int<0,2> $localurl 0=Only external URL are possible, 1=Only local URL, 2=Both external and local URL are allowed. - * @param int<-1,1> $ssl_verifypeer -1=Auto (no ssl check on dev, check on prod), 0=No ssl check, 1=Always ssl check - * @param int $timeoutconnect Timeout connect - * @param int $timeoutresponse Timeout response - * @param array $otherCurlOptions Array of other curl options to set. Example: array(CURLOPT_SSL_VERIFYPEER => false) + * @param string|array $param Parameters of URL (x=value1&y=value2 urlencoded even with POST) or may be a formatted content with $postorget='POSTALREADYFORMATED/PUTALREADYFORMATED' + * @param int<0,1> $followlocation 0=Do not follow, 1=Follow location. + * @param string[] $addheaders Array of string to add into header. Example: ('Accept: application/xrds+xml', ....) + * @param string[] $allowedschemes List of schemes that are allowed ('http' + 'https' only by default) + * @param int<0,2> $localurl 0=Only external URL are possible, 1=Only local URL, 2=Both external and local URL are allowed. + * @param int<-1,1> $ssl_verifypeer -1=Auto (no ssl check on dev, check on prod), 0=No ssl check, 1=Always ssl check + * @param int $timeoutconnect Timeout for connection time + * @param int $timeoutresponse Timeout for total time including connection + * @param array|null $otherCurlOptions Array of other curl options to set. Example: array(CURLOPT_SSL_VERIFYPEER => false) * @return array{http_code:int,content:string,curl_error_no:int,curl_error_msg:string} Returns an associative array containing the response from the server array('http_code'=>http response code, 'content'=>response, 'curl_error_no'=>errno, 'curl_error_msg'=>errmsg...) */ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = 1, $addheaders = array(), $allowedschemes = array('http', 'https'), $localurl = 0, $ssl_verifypeer = -1, $timeoutconnect = 0, $timeoutresponse = 0, $otherCurlOptions = array()) @@ -56,7 +56,7 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = dol_syslog("getURLContent postorget=".$postorget." URL=".$url); if (getDolGlobalInt('MAIN_CURL_DEBUG')) { - dol_syslog("getURLContent postorget=".$postorget." URL=".$url." param=".$param, LOG_DEBUG, 0, '_curl'); + dol_syslog("getURLContent postorget=".$postorget." URL=".$url." json_encode(param)=".json_encode($param), LOG_DEBUG, 0, '_curl'); } if (!function_exists('curl_init')) {