From cba4eab7cec303b81e69ea81301222850f36cd03 Mon Sep 17 00:00:00 2001 From: Daniel Hromada Date: Wed, 26 Jan 2011 22:47:26 +0100 Subject: [PATCH] use require_once and not include_once when including other php code (included files can contain invisible characters which make it impossible to use Header redirection) if ever some event returned false value, will call display event in order to show the error message etc. --- wwwroot/inc/eventz.inc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/wwwroot/inc/eventz.inc b/wwwroot/inc/eventz.inc index 6464345..a5b1d9f 100644 --- a/wwwroot/inc/eventz.inc +++ b/wwwroot/inc/eventz.inc @@ -29,7 +29,7 @@ elseif (is_file(INCLUDE_DIR."eventz/$event.inc")) { || ($event_node['node_permission']=='master') || ($event=='display') ) { - include_once(INCLUDE_DIR."eventz/$event.inc"); + require_once(INCLUDE_DIR."eventz/$event.inc"); $status=$event(); $_SESSION['eventz'][$event]=true; @@ -46,14 +46,18 @@ else { $status=false; } +if (!$status) { + require_once(INCLUDE_DIR."eventz/display.inc"); + display(); +} -if ($status>1) { +elseif ($status>1) { Header("Location: /id/".$status."/"); } elseif ($status) { Header("Location: /id/".$node['node_id']."/"); -} +} ?> -- 2.30.2