diff --git a/htdocs/api/index.php b/htdocs/api/index.php index afb0289aa32..a87edf8166c 100644 --- a/htdocs/api/index.php +++ b/htdocs/api/index.php @@ -120,7 +120,7 @@ if (empty($conf->global->MAIN_MODULE_API)) { // Test if explorer is not disabled if (preg_match('/api\/index\.php\/explorer/', $url) && !empty($conf->global->API_EXPLORER_DISABLED)) { $langs->load("admin"); - dol_syslog("Call Dolibarr API interfaces with module REST disabled"); + dol_syslog("Call Dolibarr API interfaces with module API REST disabled"); print $langs->trans("WarningAPIExplorerDisabled").'.

'; //session_destroy(); exit(0); @@ -153,6 +153,10 @@ preg_match('/index\.php\/([^\/]+)(.*)$/', $url, $reg); $refreshcache = (empty($conf->global->API_PRODUCTION_DO_NOT_ALWAYS_REFRESH_CACHE) ? true : false); if (!empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' || $reg[2] == '/swagger.json/root' || $reg[2] == '/resources.json' || $reg[2] == '/resources.json/root')) { $refreshcache = true; + if (!is_writable($conf->api->dir_temp)) { + print 'Erreur temp dir api/temp not writable'; + exit(0); + } } $api = new DolibarrApi($db, '', $refreshcache);