From e9ba37173ab184c620d11a5e00e5793c2efee37b Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 30 Nov 2011 20:32:45 +0000 Subject: [PATCH] remove old ISS specific redirect code and default of $_SERVER[PHP_SELF] for $url parameter of egw::redirect (not used in current EGroupware) --- phpgwapi/inc/class.egw.inc.php | 26 +++++------------------- phpgwapi/inc/class.egw_framework.inc.php | 8 ++++---- 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/phpgwapi/inc/class.egw.inc.php b/phpgwapi/inc/class.egw.inc.php index 555ba77443..75e635e3fd 100644 --- a/phpgwapi/inc/class.egw.inc.php +++ b/phpgwapi/inc/class.egw.inc.php @@ -444,12 +444,12 @@ class egw extends egw_minimal /** * Link url generator * - * @param string='' $string The url the link is for + * @param string $string The url the link is for * @param string|array $extravars='' Extra params to be passed to the url * @param string $link_app=null if appname or true, some templates generate a special link-handler url * @return string The full url after processing */ - static function link($url = '', $extravars = '', $link_app=null) + static function link($url, $extravars = '', $link_app=null) { return $GLOBALS['egw']->framework->link($url, $extravars, $link_app); } @@ -461,7 +461,7 @@ class egw extends egw_minimal * @param string/array $extravars Extra params to be passed to the url * @return string The full url after processing */ - static function redirect_link($url = '',$extravars='') + static function redirect_link($url, $extravars='') { return $GLOBALS['egw']->framework->redirect_link($url, $extravars); } @@ -473,28 +473,12 @@ class egw extends egw_minimal * * @param string The url ro redirect to */ - static function redirect($url = '') + static function redirect($url) { - /* global $HTTP_ENV_VARS; */ - - $iis = @strpos($GLOBALS['HTTP_ENV_VARS']['SERVER_SOFTWARE'], 'IIS', 0); - // Determines whether the current output buffer should be flushed $do_flush = true; - if(!$url) - { - $url = $_SERVER['PHP_SELF']; - } - if($iis) - { - echo "\n\n\nRedirecting to $url"; - echo "\n"; - echo "\n"; - echo "

Please continue to this page

"; - echo "\n"; - } - else if (egw_json_response::isJSONResponse() || egw_json_request::isJSONRequest()) + if (egw_json_response::isJSONResponse() || egw_json_request::isJSONRequest()) { $response = egw_json_response::get(); $response->redirect($url); diff --git a/phpgwapi/inc/class.egw_framework.inc.php b/phpgwapi/inc/class.egw_framework.inc.php index 4d56db6594..91d03c8cc9 100644 --- a/phpgwapi/inc/class.egw_framework.inc.php +++ b/phpgwapi/inc/class.egw_framework.inc.php @@ -113,11 +113,11 @@ abstract class egw_framework /** * Link url generator * - * @param string $string The url the link is for + * @param string $url The url the link is for * @param string/array $extravars Extra params to be passed to the url * @return string The full url after processing */ - static function link($url = '', $extravars = '') + static function link($url, $extravars = '') { return $GLOBALS['egw']->session->link($url, $extravars); } @@ -125,11 +125,11 @@ abstract class egw_framework /** * Redirects direct to a generated link * - * @param string $string The url the link is for + * @param string $url The url the link is for * @param string/array $extravars Extra params to be passed to the url * @return string The full url after processing */ - static function redirect_link($url = '',$extravars='') + static function redirect_link($url, $extravars='') { egw::redirect(self::link($url, $extravars)); }