This commit is contained in:
Laurent Destailleur 2016-12-10 12:11:09 +01:00
parent f6c42053a4
commit d5c7151bc8

View File

@ -507,9 +507,8 @@ function detect_dolibarr_main_document_root()
{
// If PHP is in CGI mode, SCRIPT_FILENAME is PHP's path.
// Since that's not what we want, we suggest $_SERVER["DOCUMENT_ROOT"]
if (preg_match('/php$/i', $_SERVER["SCRIPT_FILENAME"]) || preg_match('/[\\/]php$/i',
$_SERVER["SCRIPT_FILENAME"]) || preg_match('/php\.exe$/i', $_SERVER["SCRIPT_FILENAME"])
) {
if ($_SERVER["SCRIPT_FILENAME"] == 'php' || preg_match('/[\\/]php$/i', $_SERVER["SCRIPT_FILENAME"]) || preg_match('/php\.exe$/i', $_SERVER["SCRIPT_FILENAME"]))
{
$dolibarr_main_document_root = $_SERVER["DOCUMENT_ROOT"];
if (!preg_match('/[\\/]dolibarr[\\/]htdocs$/i', $dolibarr_main_document_root)) {