-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
81 lines (63 loc) · 2.09 KB
/
index.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
<?php
/* ====================
Seditio - Website engine
Copyright Neocrome & Seditio Team
https://seditio.com.tr
[BEGIN_SED]
File=index.php
Version=178
Updated=2022-jun-15
Type=Core
Author=Seditio Team
Description=SEF Url's loader
[END_SED]
==================== */
define('SED_CODE', TRUE);
define('SED_ROOT', dirname(__FILE__));
require(SED_ROOT . '/system/config.urlrewrite.php');
$request_uri = $_SERVER['REQUEST_URI'];
$subdir_uri = (mb_strlen(dirname($_SERVER['PHP_SELF'])) > 1) ? dirname($_SERVER['PHP_SELF']) : "";
$request_uri = str_replace($subdir_uri, "", $request_uri);
$vars_req = array();
$params_req = "";
if (($pos = strpos($request_uri, "?")) !== false) {
$params_req = mb_substr($request_uri, $pos + 1);
$request_uri = mb_substr($request_uri, 0, $pos);
parse_str($params_req, $vars_req);
$params_req = "&" . urldecode($params_req);
}
foreach ($sed_urlrewrite as $val) {
if (preg_match($val['cond'], $request_uri)) {
$url = preg_replace($val['cond'], $val['rule'], $request_uri);
$url = urldecode($url);
if (($pos = mb_strpos($url, "?")) !== false) {
$params = mb_substr($url, $pos + 1);
parse_str($params, $vars);
$vars += $vars_req;
$params = $params . $params_req;
$_GET += $vars;
$_REQUEST += $vars;
//$GLOBALS += $vars;
$_SERVER["QUERY_STRING"] = $QUERY_STRING = $params;
}
$pos = mb_strpos($url, ".php");
$incl = mb_substr($url, 0, $pos + 4);
include_once(SED_ROOT . '/' . $incl);
die();
}
}
$module = @$_GET['module'];
if (!empty($module)) {
$system_core = array("install", "admin", "captcha", "resizer", "forums", "gallery", "index", "list", "message", "page", "pfs", "plug", "pm", "polls", "rss", "sitemap", "users", "view");
if (in_array($module, $system_core)) {
$system_incl_dir = ($module == "install") ? SED_ROOT . "/system/install/" : SED_ROOT . "/system/core/" . $module . "/";
include_once($system_incl_dir . $module . ".php");
die();
}
}
if (str_replace("/", "", $request_uri) == "index.php") {
header("Location: /", TRUE, 301);
exit();
}
header("HTTP/1.1 404 Not Found");
exit;