18if (!defined(
'LEPTON_PATH') && !defined(
'LEPTON_INSTALL_PROCESS'))
20 require_once __DIR__.
"/functions/function.lepton_autoloader.php";
21 spl_autoload_register(
"lepton_autoloader",
true);
27 $temp_path = (dirname($_SERVER[
'SCRIPT_FILENAME'])) .
"/register_class_secure.php";
28 if (file_exists($temp_path))
30 require_once $temp_path;
35 $allowed = $oSecure->testFile($_SERVER[
'SCRIPT_NAME']);
40 $admin_dir = $oSecure->getAdminDir();
42 if ((str_contains($_SERVER[
'SCRIPT_NAME'], $admin_dir.
'/media/index.php')) || (str_contains($_SERVER[
'SCRIPT_NAME'], $admin_dir.
'/preferences/index.php')))
46 elseif ((str_contains($_SERVER[
'SCRIPT_NAME'], $admin_dir .
'/index.php')))
49 $leptoken = isset($_GET[
'leptoken']) ?
"?leptoken=" . $_GET[
'leptoken'] :
"";
50 header(
"Location: ../".$admin_dir.
'/start/index.php'.$leptoken);
53 elseif (str_contains($_SERVER[
'SCRIPT_NAME'],
'/index.php'))
56 header(
"Location: ../index.php");
64 header($_SERVER[
'SERVER_PROTOCOL'] .
" 403 Forbidden");
67 exit(
'<p><b>ACCESS DENIED! [L3]</b> - Invalid call of <i>'.$_SERVER[
'SCRIPT_NAME'].
'</i></p>');
72 $config_path = dirname(dirname(__FILE__)).
"/config/config.php";
73 require_once $config_path;
76if (defined(
"FRONTEND"))
79 if (!function_exists(
'lep_sec_formdata'))
81 function lep_sec_formdata(array &$arr): void
83 foreach ($arr as $key => $value)
87 lep_sec_formdata($value);
93 [
'<script',
'</script'],
94 [
'<script',
'</script' ],
96 $value = preg_replace(
'#(\<script.+?)>#i',
'$1>', $value);
97 $value = preg_replace(
'#(\<\/script)>#i',
'$1>', $value);
99 $arr[$key] = str_replace(
109 if (isset($_SESSION) && !defined(
'LEP_SEC_FORMDATA'))
113 lep_sec_formdata($_GET);
117 lep_sec_formdata($_POST);
119 if (!empty($_REQUEST))
121 lep_sec_formdata($_REQUEST);
125 define(
'LEP_SEC_FORMDATA',
true);
static getInstance(mixed $value=null)