Fix #yogosha11452

This commit is contained in:
Laurent Destailleur 2022-06-25 02:18:16 +02:00
parent f5eeb93350
commit 00649e791c
2 changed files with 10 additions and 3 deletions

View File

@ -205,8 +205,8 @@ if (empty($error) && !empty($xml)) {
$constvalue = (empty($constvalue) ? '0' : $constvalue); $constvalue = (empty($constvalue) ? '0' : $constvalue);
// Value found // Value found
$value = ''; $value = '';
if ($constname && $conf->global->$constname != '') { if ($constname && getDolGlobalString($constname) != '') {
$value = $conf->global->$constname; $value = getDolGlobalString($constname);
} }
$valueforchecksum = (empty($value) ? '0' : $value); $valueforchecksum = (empty($value) ? '0' : $value);
@ -388,7 +388,9 @@ if (empty($error) && !empty($xml)) {
$out .= '</table>'; $out .= '</table>';
$out .= '</div>'; $out .= '</div>';
} else { } else {
print 'Error: Failed to found dolibarr_htdocs_dir into XML file '.$xmlfile; print '<div class="error">';
print 'Error: Failed to found <b>dolibarr_htdocs_dir</b> into content of XML file:<br>'.dol_escape_htmltag(dol_trunc($xmlfile, 500));
print '</div><br>';
$error++; $error++;
} }

View File

@ -107,6 +107,11 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation =
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, empty($conf->global->MAIN_USE_CONNECT_TIMEOUT) ? 5 : $conf->global->MAIN_USE_CONNECT_TIMEOUT); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, empty($conf->global->MAIN_USE_CONNECT_TIMEOUT) ? 5 : $conf->global->MAIN_USE_CONNECT_TIMEOUT);
curl_setopt($ch, CURLOPT_TIMEOUT, empty($conf->global->MAIN_USE_RESPONSE_TIMEOUT) ? 30 : $conf->global->MAIN_USE_RESPONSE_TIMEOUT); curl_setopt($ch, CURLOPT_TIMEOUT, empty($conf->global->MAIN_USE_RESPONSE_TIMEOUT) ? 30 : $conf->global->MAIN_USE_RESPONSE_TIMEOUT);
/*
if ($maxsize) {
curl_setopt($ch, CURLOPT_MAXFILESIZE_LARGE, $maxsize);
} */
//curl_setopt($ch, CURLOPT_SAFE_UPLOAD, true); // PHP 5.5 //curl_setopt($ch, CURLOPT_SAFE_UPLOAD, true); // PHP 5.5
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // We want response curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // We want response
if ($postorget == 'POST') { if ($postorget == 'POST') {