mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-24 02:11:27 +01:00
Fix: better solution with new system
This commit is contained in:
@@ -72,18 +72,8 @@ function GETPOST($paramname,$check='',$method=0)
|
||||
*/
|
||||
function dol_getprefix()
|
||||
{
|
||||
// Add real path in session name
|
||||
$realpath='';
|
||||
if (preg_match('/^([^.]+)\/htdocs\//i', realpath($_SERVER["SCRIPT_FILENAME"]), $regs)) $realpath = isset($regs[1])?$regs[1]:'';
|
||||
if (defined('DOL_DOCUMENT_ROOT_ALT') && DOL_DOCUMENT_ROOT_ALT)
|
||||
{
|
||||
$realpath='';
|
||||
// Warning, using alt feature is a security hole because path is not in session name, so being authenticated into an instance allow access on another
|
||||
// FIXME The fix is to use only "root url" like the one defined into $dolibarr_main_url_root
|
||||
}
|
||||
//print "x".$realpath."-".$_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]."-".md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]);
|
||||
//return md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].$realpath);
|
||||
return md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].$realpath);
|
||||
//print "prefix=".$_SERVER["SERVER_NAME"]."-".$_SERVER["DOCUMENT_ROOT"]."-".DOL_DOCUMENT_ROOT;
|
||||
return md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].DOL_DOCUMENT_ROOT);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user