-
Notifications
You must be signed in to change notification settings - Fork 23
/
bootstrap.php
146 lines (125 loc) · 5.14 KB
/
bootstrap.php
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?php
/*********************************************************
| eXtreme-Fusion 5
| Content Management System
|
| Copyright (c) 2005-2013 eXtreme-Fusion Crew
| http://extreme-fusion.org/
|
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
*********************************************************/
error_reporting(-1);
if ( ! isset($_SESSION))
{
session_start();
}
// Check if magic_quotes_runtime is active
if (get_magic_quotes_runtime())
{
if (version_compare(PHP_VERSION, '5.3.0', '<'))
{
// Deactivate when function is not deprecated PHP < 5.3.0
set_magic_quotes_runtime(0);
}
else
{
// Deactivate when function PHP > 5.3.0
ini_set("magic_quotes_gpc", 0);
ini_set("magic_quotes_runtime", 0);
}
}
// Disabling magic quotes at runtime
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);
}
// Undo register_globals
if (ini_get('register_globals'))
{
$array= array('_GET', '_POST', '_COOKIE', '_FILES', '_SERVER', '_SESSION', '_ENV');
foreach ($array as $value)
{
foreach ($GLOBALS[$value] as $key => $var)
{
if (isset($GLOBALS[$key]) && $var === $GLOBALS[$key])
{
if (in_array($key, $array))
{
exit('Hacking action!');
}
unset($GLOBALS[$key]);
}
}
}
}
defined ('SYSTEM_VERSION') || define('SYSTEM_VERSION', '5.0.5-unstable-master-repo');
//defined ('SYSTEM_VERSION') || define('SYSTEM_VERSION', '5.0.4');
// Array-imploded data separator for Database fields
defined('DBS') || define('DBS', '^');
defined('FILE_SELF') || define('FILE_SELF', basename($_SERVER['PHP_SELF']));
defined('FILE_PATH') || define('FILE_PATH', $_SERVER['PHP_SELF']);
// HTTP_HOST może być niedostępne w CRON
defined('SITE_HOST') || define('SITE_HOST', isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '');
// System identifier
defined('EF5_SYSTEM') || define('EF5_SYSTEM', TRUE);
// Paths by __DIR__ to system section
defined('DIR_AJAX') || define('DIR_AJAX', DIR_SITE.'ajax'.DS);
defined('DIR_CACHE') || define('DIR_CACHE', DIR_SITE.'cache'.DS);
defined('DIR_LOCALE') || define('DIR_LOCALE', DIR_SITE.'locale'.DS);
defined('DIR_MODULES') || define('DIR_MODULES', DIR_SITE.'modules'.DS);
defined('DIR_PAGES') || define('DIR_PAGES', DIR_SITE.'pages'.DS);
defined('DIR_THEMES') || define('DIR_THEMES', DIR_SITE.'themes'.DS);
defined('DIR_SYSTEM') || define('DIR_SYSTEM', DIR_SITE.'system'.DS);
defined('DIR_CLASS') || define('DIR_CLASS', DIR_SYSTEM.'class'.DS);
defined('DIR_FUNCTION') || define('DIR_FUNCTION', DIR_SYSTEM.'function'.DS);
defined('DIR_INCLUDES') || define('DIR_INCLUDES', DIR_SYSTEM.'includes'.DS);
defined('DIR_TEMPLATES') || define('DIR_TEMPLATES', DIR_SITE.'templates'.DS);
defined('DIR_IMAGES') || define('DIR_IMAGES', DIR_TEMPLATES.'images'.DS);
defined('DIR_UPLOAD') || define('DIR_UPLOAD', DIR_SITE.'upload'.DS);
// Paths by __DIR__ to admin section
defined('DIR_ADMIN') || define('DIR_ADMIN', DIR_SITE.'admin'.DS);
defined('DIR_ADMIN_CACHE') || define('DIR_ADMIN_CACHE', DIR_ADMIN.'cache'.DS);
defined('DIR_ADMIN_PAGES') || define('DIR_ADMIN_PAGES', DIR_ADMIN.'pages'.DS);
defined('DIR_ADMIN_TEMPLATES') || define('DIR_ADMIN_TEMPLATES', DIR_ADMIN.'templates'.DS);
defined('DIR_ADMIN_IMAGES') || define('DIR_ADMIN_IMAGES', DIR_ADMIN_TEMPLATES.'images'.DS);
// URL to system section
defined('ADDR_THEMES') || define('ADDR_THEMES', ADDR_SITE.'themes/');
defined('ADDR_AJAX') || define('ADDR_AJAX', ADDR_SITE.'pages/ajax/');
defined('ADDR_TEMPLATES') || define('ADDR_TEMPLATES', ADDR_SITE.'templates/');
defined('ADDR_CSS') || define('ADDR_CSS', ADDR_TEMPLATES.'stylesheet/');
defined('ADDR_IMAGES') || define('ADDR_IMAGES', ADDR_TEMPLATES.'images/');
defined('ADDR_JS') || define('ADDR_JS', ADDR_TEMPLATES.'javascripts/');
defined('ADDR_COMMON_JS') || define('ADDR_COMMON_JS', ADDR_TEMPLATES.'javascripts/common/');
defined('ADDR_COMMON_CSS') || define('ADDR_COMMON_CSS', ADDR_TEMPLATES.'stylesheet/common/');
defined('ADDR_BBCODE') || define('ADDR_BBCODE', ADDR_SITE.'system/bbcodes/');
defined('ADDR_MODULES') || define('ADDR_MODULES', ADDR_SITE.'modules/');
defined('ADDR_UPLOAD') || define('ADDR_UPLOAD', ADDR_SITE.'upload/');
// URL to admin section
defined('ADDR_ADMIN') || define('ADDR_ADMIN', ADDR_SITE.'admin/');
defined('ADDR_ADMIN_TEMPLATES') || define('ADDR_ADMIN_TEMPLATES', ADDR_ADMIN.'templates/');
defined('ADDR_ADMIN_IMAGES') || define('ADDR_ADMIN_IMAGES', ADDR_ADMIN_TEMPLATES.'images/');
// OPT constant
defined('OPT_DIR') || define('OPT_DIR', DIR_SYSTEM.'opt'.DS);