summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/index.php')
-rw-r--r--frontend/index.php13
1 files changed, 6 insertions, 7 deletions
diff --git a/frontend/index.php b/frontend/index.php
index a103dd9..1c1ea7d 100644
--- a/frontend/index.php
+++ b/frontend/index.php
@@ -1,12 +1,11 @@
<?php
define('E_DEFAULT', error_reporting(E_ALL|E_STRICT));
-date_default_timezone_set('UTC');
require_once('../shared/include/includes.php');
require_once('include/error_handling.php');
+register_shutdown_function('onshutdown', realpath('include/footer.php'), realpath('include/header.php')); // Needed to ensure that errors are printed
require_once('include/constants.php');
require_once('include/setup.php');
-register_shutdown_function('onshutdown', realpath('include/footer.php'), realpath('include/header.php'));
-$request=get_magic_quotes_gpc()?r_stripslashes($_REQUEST):$_REQUEST;
+if (get_magic_quotes_gpc()) r_stripslashes($_REQUEST);
$routing=fopen('routing.csv', 'r');
for ($line=fgets($routing, 32768); !feof($routing); $line=fgets($routing, 32768)) {
$line=trim($line, "\r\n");
@@ -28,12 +27,12 @@ for ($line=fgets($routing, 32768); !feof($routing); $line=fgets($routing, 32768)
fclose($routing);
for ($i=0; $i < count($vars); $i++) {
if (strpos($vars[$i],'=')) {
- $request[substr($vars[$i],0,strpos($vars[$i],'='))]=substr($vars[$i],strpos($vars[$i],'=')+1);
+ $_REQUEST[substr($vars[$i],0,strpos($vars[$i],'='))]=substr($vars[$i],strpos($vars[$i],'=')+1);
} else {
if ($i+1 > count($matches)-1) {
debug('routing',print_error('Routing failure','Trying to set request variable "'.$vars[$i].'" but ran out of matches (page='.$dest.')'));
} else {
- $request[$vars[$i]]=$matches[$i+1];
+ $_REQUEST[$vars[$i]]=$matches[$i+1];
}
}
}
@@ -46,7 +45,7 @@ for ($line=fgets($routing, 32768); !feof($routing); $line=fgets($routing, 32768)
$dest=str_replace(array('/', '-'), '_', $dest);
$initfunc='init_'.$dest;
if (function_exists($initfunc)) {
- $value=$initfunc();
+ $value=$initfunc($S);
if ($value === null) {
break;
} elseif (is_array($value)) {
@@ -73,7 +72,7 @@ for ($line=fgets($routing, 32768); !feof($routing); $line=fgets($routing, 32768)
}
$bodyfunc='body_'.str_replace('/','_',$dest);
if (function_exists($bodyfunc)) {
- $bodyresult=$bodyfunc();
+ $bodyresult=$bodyfunc($S);
if ($bodyresult !== null) {
require($bodyresult);
}