From 15c8d588b6e72e01d6a0463d0b11542b09108f5b Mon Sep 17 00:00:00 2001 From: shish Date: Sat, 27 Oct 2007 19:39:12 +0000 Subject: [PATCH] pull neatness and magic quotes fix from trunk git-svn-id: file:///home/shish/svn/shimmie2/branches/branch_2.1@573 7f39781d-f577-437e-ae19-be835c7a54ca --- index.php | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/index.php b/index.php index 8c00cb4d..a62a0624 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());