mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 09:04:53 +01:00
fixed bug in common::get_referer, which gives a warning and wrong result if eGW is installed in the docroot
This commit is contained in:
parent
311f8a5a36
commit
cde95cd926
@ -2047,9 +2047,17 @@
|
||||
{
|
||||
$referer = $_SERVER['HTTP_REFERER'];
|
||||
|
||||
$parts = explode($GLOBALS['egw_info']['server']['webserver_url'],$referer);
|
||||
|
||||
$referer = str_replace('/etemplate/process_exec.php','/index.php',array_pop($parts));
|
||||
$webserver_url = $GLOBALS['egw_info']['server']['webserver_url'];
|
||||
if (empty($webserver_url) || $webserver_url == '/') // fix for eGW installed in the docroot
|
||||
{
|
||||
$referer = preg_replace('/^https?:\/\/[^\/]+/','',$referer); // removing the domain part
|
||||
}
|
||||
else
|
||||
{
|
||||
$parts = explode($webserver_url,$referer);
|
||||
$referer = array_pop($parts);
|
||||
}
|
||||
$referer = str_replace('/etemplate/process_exec.php','/index.php',$referer);
|
||||
|
||||
if (empty($referer)) $referer = $default;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user