Add warning in log if conf file setup not correct

This commit is contained in:
Laurent Destailleur 2017-06-19 12:50:13 +02:00
parent 5f187f851f
commit a2ca6d5ef9

View File

@ -654,7 +654,11 @@ if (! defined('NOLOGIN'))
if (constant('DOL_MAIN_URL_ROOT')) $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_MAIN_URL_ROOT'),'/').'/', '', $relativepathstring);
$relativepathstring = preg_replace('/^custom\//', '', $relativepathstring);
$relativepathstring = preg_replace('/^\//', '', $relativepathstring);
if (! empty($_SESSION['lastsearch_values_tmp_'.$relativepathstring]))
if (preg_match('/^https?:/', $relativepathstring))
{
dol_syslog('Failted to save the search criteria. Calculation of relative page fails (check parameter $dolibarr_main_url_root in conf file match the URL you use in your browser).', LOG_WARNING);
}
elseif (! empty($_SESSION['lastsearch_values_tmp_'.$relativepathstring]))
{
$_SESSION['lastsearch_values_'.$relativepathstring]=$_SESSION['lastsearch_values_tmp_'.$relativepathstring];
unset($_SESSION['lastsearch_values_tmp_'.$relativepathstring]);