]> git.sur5r.net Git - contagged/blob - init.php
PHP5 notice cleanups
[contagged] / init.php
1 <?
2   require_once('config.php');
3   require_once('lang/'.$conf['lang'].'.php');
4   require_once('functions.php');
5   require_once('template.php');
6   require_once('smarty/Smarty.class.php');
7
8   //init session
9   session_name("ldapab");
10   session_start();
11   
12   //kill magic quotes
13   if (get_magic_quotes_gpc()) {
14     if (!empty($_GET))    remove_magic_quotes($_GET);
15     if (!empty($_POST))   remove_magic_quotes($_POST);
16     if (!empty($_COOKIE)) remove_magic_quotes($_COOKIE);
17     if (!empty($_REQUEST)) remove_magic_quotes($_REQUEST);
18     if (!empty($_SESSION)) remove_magic_quotes($_SESSION);
19     ini_set('magic_quotes_gpc', 0);
20   }
21   set_magic_quotes_runtime(0);
22
23   function remove_magic_quotes(&$array) {
24     foreach (array_keys($array) as $key) {
25       if (is_array($array[$key])) {
26         remove_magic_quotes($array[$key]);
27       }else {
28         $array[$key] = stripslashes($array[$key]);
29       }
30     } 
31   } 
32
33   //prepare SMARTY object
34   $smarty = new Smarty;
35   $smarty->compile_dir   = './cache';
36   $smarty->use_sub_dirs  = 0;
37   $smarty->template_dir  = './templates';
38   $smarty->force_compile = $conf['smartycompile'];
39 ?>