2001-12-31 13:44:47 +01:00
|
|
|
<?php
|
|
|
|
/**************************************************************************\
|
2003-12-31 14:18:12 +01:00
|
|
|
* eGroupWare - save redirect script *
|
2001-12-31 13:44:47 +01:00
|
|
|
* idea by: Jason Wies <jason@xc.net> *
|
|
|
|
* doing and adding to cvs: Lars Kneschke <lkneschke@linux-at-work.de> *
|
2003-12-31 14:18:12 +01:00
|
|
|
* http://www.egroupware.org *
|
2001-12-31 13:44:47 +01:00
|
|
|
* -------------------------------------------- *
|
|
|
|
* This program is free software; you can redistribute it and/or modify it *
|
|
|
|
* under the terms of the GNU General Public License as published by the *
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your *
|
|
|
|
* option) any later version. *
|
|
|
|
\**************************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
2003-09-11 07:35:51 +02:00
|
|
|
/*
|
|
|
|
Use this script when you want to link to a external url.
|
2003-12-31 14:18:12 +01:00
|
|
|
This way you don't send something like sessionid as referer
|
2003-09-11 07:35:51 +02:00
|
|
|
|
|
|
|
Use this in your app:
|
|
|
|
|
|
|
|
"<a href=\"$webserverURL/redirect.php?go=".htmlentities(urlencode('http://www.egroupware.org')).'">'
|
|
|
|
*/
|
|
|
|
|
2004-01-10 20:19:53 +01:00
|
|
|
if(!function_exists('html_entity_decode'))
|
|
|
|
{
|
|
|
|
function html_entity_decode($given_html, $quote_style = ENT_QUOTES)
|
|
|
|
{
|
|
|
|
$trans_table = array_flip(get_html_translation_table( HTML_SPECIALCHARS, $quote_style));
|
|
|
|
$trans_table['''] = "'";
|
|
|
|
return(strtr($given_html, $trans_table));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-12-31 14:18:12 +01:00
|
|
|
if($_GET['go'])
|
2001-12-31 13:44:47 +01:00
|
|
|
{
|
2009-06-19 10:28:03 +02:00
|
|
|
$url= html_entity_decode(urldecode($_GET['go']));
|
|
|
|
unset($_GET['go']);
|
2010-03-22 13:17:42 +01:00
|
|
|
if (!empty($_GET)) $url=$url."&".http_build_query($_GET);
|
2009-06-19 10:28:03 +02:00
|
|
|
|
|
|
|
Header('Location: ' . html_entity_decode(urldecode($url)));
|
2003-12-31 14:18:12 +01:00
|
|
|
exit;
|
2001-12-31 13:44:47 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-12-31 14:18:12 +01:00
|
|
|
echo "this won't work!!";
|
2001-12-31 13:44:47 +01:00
|
|
|
}
|
2003-12-31 14:18:12 +01:00
|
|
|
?>
|