From ef9b4f798a6523547e7db3169c921a52d36fe5d1 Mon Sep 17 00:00:00 2001 From: nbm Date: Mon, 12 Dec 2005 15:35:00 +0000 Subject: [PATCH] Make the process of redirection somewhat controllable, by introducing the oRedirector attribute to KTDispatcher, which is called when a redirection is required. --- lib/dispatcher.inc.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/dispatcher.inc.php b/lib/dispatcher.inc.php index 2175566..027d7bc 100644 --- a/lib/dispatcher.inc.php +++ b/lib/dispatcher.inc.php @@ -5,6 +5,12 @@ require_once(KT_LIB_DIR . '/actions/portletregistry.inc.php'); require_once(KT_LIB_DIR . "/widgets/portlet.inc.php"); require_once(KT_LIB_DIR . '/templating/kt3template.inc.php'); +class KTDispatchStandardRedirector { + function redirect($url) { + redirect($url); + } +} + class KTDispatcher { var $event_var = "action"; var $bAutomaticTransaction = false; @@ -13,6 +19,7 @@ class KTDispatcher { function KTDispatcher() { $this->oValidator =& new KTDispatcherValidation($this); + $this->oRedirector =& new KTDispatchStandardRedirector($this); } function dispatch () { @@ -89,7 +96,8 @@ class KTDispatcher { $sQuery = '?action=' . $event; } } - exit(redirect($_SERVER["PHP_SELF"] . $sQuery)); + $this->oRedirector->redirect($_SERVER["PHP_SELF"] . $sQuery); + exit(0); } function errorRedirectToMain($error_message, $sQuery = "") { -- libgit2 0.21.4