From 56d05dbd8dcf9e71cb142ae0355c0448cc5c132f Mon Sep 17 00:00:00 2001 From: shish Date: Sat, 27 Oct 2007 19:38:13 +0000 Subject: [PATCH] tidy up index.php, and fix magic quotes git-svn-id: file:///home/shish/svn/shimmie2/trunk@572 7f39781d-f577-437e-ae19-be835c7a54ca --- index.php | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/index.php b/index.php index b9c48fb9..8255b392 100644 --- a/index.php +++ b/index.php @@ -1,4 +1,5 @@ EOD; exit; } -$files = array_merge(glob("core/*.php"), glob("core/*/*.php"), glob("ext/*/main.php")); +function stripslashes_r($arr) { + return is_array($arr) ? array_map('stripslashes_r', $arr) : stripslashes($arr); +} +if(get_magic_quotes_gpc()) $GLOBALS = stripslashes_r($GLOBALS); + +// load base files +$files = array_merge(glob("core/*.php"), glob("core/*/*.php"), glob("ext/*/main.php")); foreach($files as $filename) { require_once $filename; } + +// connect to database $database = new Database(); $database->db->fnExecute = '_count_execs'; $config = new Config($database); + + +// load the theme parts $_theme = $config->get_string("theme", "default"); if(!file_exists("themes/$_theme")) $_theme = "default"; require_once "themes/$_theme/page.class.php"; @@ -43,6 +47,9 @@ $themelets = array_merge(glob("ext/*/theme.php"), glob("themes/$_theme/*.theme.p foreach($themelets as $filename) { require_once $filename; } + + +// start the page generation waterfall $page = new Page(); $user = _get_user(); send_event(new InitExtEvent());