Debug v19

This commit is contained in:
Laurent Destailleur
2023-12-19 14:03:17 +01:00
parent 1044e5c7d4
commit e7c405425c
3 changed files with 15 additions and 9 deletions

View File

@@ -1220,10 +1220,10 @@ function dol_buildpath($path, $type = 0, $returnemptyifnotfound = 0)
foreach ($conf->file->dol_document_root as $key => $dirroot) { // ex: array(["main"]=>"/home/main/htdocs", ["alt0"]=>"/home/dirmod/htdocs", ...)
if ($key == 'main') {
if ($type == 3) {
global $dolibarr_main_url_root;
/*global $dolibarr_main_url_root;*/
// Define $urlwithroot
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($conf->file->dol_main_url_root));
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
@@ -1244,10 +1244,10 @@ function dol_buildpath($path, $type = 0, $returnemptyifnotfound = 0)
$res = (preg_match('/^http/i', $conf->file->dol_url_root[$key]) ? '' : DOL_MAIN_URL_ROOT).$conf->file->dol_url_root[$key].'/'.$path;
}
if ($type == 3) {
global $dolibarr_main_url_root;
/*global $dolibarr_main_url_root;*/
// Define $urlwithroot
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($conf->file->dol_main_url_root));
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current