Fix Do not always append htdocs to include path
Serving the htdocs directly is a best practice. The old code generates a bogus include path in that case. This code mitigates the issue by setting an include path only when needed.
This commit is contained in:
parent
9cbd236c8c
commit
d9acf32861
@ -164,7 +164,10 @@ if (! defined('NOSCANPOSTFORINJECTION'))
|
||||
}
|
||||
|
||||
// This is to make Dolibarr working with Plesk
|
||||
if (! empty($_SERVER['DOCUMENT_ROOT'])) set_include_path($_SERVER['DOCUMENT_ROOT'].'/htdocs');
|
||||
if (! empty($_SERVER['DOCUMENT_ROOT']) && substr($_SERVER['DOCUMENT_ROOT'], -6) !== 'htdocs') {
|
||||
set_include_path($_SERVER['DOCUMENT_ROOT'] . '/htdocs');
|
||||
}
|
||||
}
|
||||
|
||||
// Include the conf.php and functions.lib.php
|
||||
require_once 'filefunc.inc.php';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user