made get_referer work with $phpgw_info['server']['webserver_url'] like 'http:/domain/path'

(still works with '/path' too)
This commit is contained in:
Ralf Becker 2001-07-14 09:14:28 +00:00
parent e356f7ba38
commit 7f4ab3a98e

View File

@ -199,12 +199,16 @@
if (!$referer) if (!$referer)
$referer = $HTTP_REFERER; $referer = $HTTP_REFERER;
$url = parse_url($referer); //echo "<p>get_referer: referer=$referer, webserver_url=".$phpgw_info['server']['webserver_url'];
$referer = str_replace($phpgw_info['server']['webserver_url'],'',
$url['path']); $url = parse_url(str_replace($phpgw_info['server']['webserver_url'],'',
$referer));
$referer = $url['path'];
if ($url['query']) if ($url['query'])
$referer .= '?'.$url['query']; $referer .= '?'.$url['query'];
//echo "<p>referer: $HTTP_REFERER --> $referer</p>";
//echo " --> $referer</p>";
return $referer; return $referer;
} }