diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index 54ee7c77842c1..948d5eebff9a7 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -720,8 +720,7 @@ function detect_dolibarr_main_document_root() */ function detect_dolibarr_main_data_root($dolibarr_main_document_root) { - $dolibarr_main_data_root = preg_replace("/\/htdocs$/", "", $dolibarr_main_document_root); - $dolibarr_main_data_root .= "/documents"; + $dolibarr_main_data_root = preg_replace("/\/[^\/]+$/", "/documents", $dolibarr_main_document_root); return $dolibarr_main_data_root; }