-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
97 lines (63 loc) · 2.17 KB
/
index.php
File metadata and controls
97 lines (63 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
session_start();
error_reporting(E_ALL);
ini_set('display_errors','On');
define('INSTALLDIR', dirname(__FILE__));
/*
Turn off magic quotes
*/
if (get_magic_quotes_gpc()) {
$process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
while (list($key, $val) = each($process)) {
foreach ($val as $k => $v) {
unset($process[$key][$k]);
if (is_array($v)) {
$process[$key][stripslashes($k)] = $v;
$process[] = &$process[$key][stripslashes($k)];
} else {
$process[$key][stripslashes($k)] = stripslashes($v);
}
}
}
unset($process);
}
/*
Normally all GET request are applied urldecode before being available to the
acesss throught $_GET so this causes a problem if our url contains html special character for /
which are converted to / on urlencode. This is an integrity issue with the data as we are exploding the
url action=controller/method/params on "/".
To circumvent this issue either you choose the REQUEST_URI variable available in $_SERVER or
variable that might include such data should be not be part of the action url variable in $_GET.
*/
require dirname(__FILE__).'/config/setting.php';
require_once(dirname(__FILE__).'/config/autoload.php');
require_once(dirname(__FILE__).'/config/database.php');
spl_autoload_register('__autoload');
/*
* Clean http request
*/
$_GET = Core_Helper_Tool::clean($_GET);
$_POST = Core_Helper_Tool::clean($_POST);
$_REQUEST = Core_Helper_Tool::clean($_REQUEST);
$_COOKIE = Core_Helper_Tool::clean($_COOKIE);
$_FILES = Core_Helper_Tool::clean($_FILES);
$_SERVER = Core_Helper_Tool::clean($_SERVER);
set_include_path(get_include_path() . PATH_SEPARATOR . INSTALLDIR . '/extlib/');
require_once('PEAR.php');
require_once('PEAR/Exception.php');
require_once('MDB2.php');
//require_once('DB/DataObject.php');
//require_once('DB/DataObject/Cast.php'); # for dates
require_once 'php-gettext/gettext.inc';
//locale
if (isSet($_GET["locale"]))
$locale = $_GET["locale"];
else
$locale=LOCALE;
putenv("LC_ALL=$locale");
setlocale(LC_ALL, $locale);
bindtextdomain("messages", "./locale");
textdomain("messages");
//bootCMF
require dirname(__FILE__).'/app/bootcmf.php';
?>