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());