Skip to content
Snippets Groups Projects
Commit d5966f94 authored by Neil Orley's avatar Neil Orley
Browse files

FIX Implementation of a Luracast recommandation for the REST api server (#7370)

parent caf4ca74
No related branches found
No related tags found
No related merge requests found
...@@ -56,9 +56,9 @@ class DolibarrApi ...@@ -56,9 +56,9 @@ class DolibarrApi
$this->db = $db; $this->db = $db;
$production_mode = ( empty($conf->global->API_PRODUCTION_MODE) ? false : true ); $production_mode = ( empty($conf->global->API_PRODUCTION_MODE) ? false : true );
$this->r = new Restler($production_mode, $refreshCache); $this->r = new Restler($production_mode, $refreshCache);
$this->r->setBaseUrls(DOL_MAIN_URL_ROOT, $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($dolibarr_main_url_root)); $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file $this->r->setBaseUrls($urlwithroot);
$this->r->setAPIVersion(1); $this->r->setAPIVersion(1);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment