]>
Commit | Line | Data |
---|---|---|
e0d91d84 | 1 | <?php |
88e8fb3a AD |
2 | set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR . |
3 | get_include_path()); | |
3f363052 | 4 | |
e0d91d84 AD |
5 | /* remove ill effects of magic quotes */ |
6 | ||
7 | if (get_magic_quotes_gpc()) { | |
8 | function stripslashes_deep($value) { | |
9 | $value = is_array($value) ? | |
10 | array_map('stripslashes_deep', $value) : stripslashes($value); | |
11 | return $value; | |
12 | } | |
13 | ||
14 | $_POST = array_map('stripslashes_deep', $_POST); | |
15 | $_GET = array_map('stripslashes_deep', $_GET); | |
16 | $_COOKIE = array_map('stripslashes_deep', $_COOKIE); | |
17 | $_REQUEST = array_map('stripslashes_deep', $_REQUEST); | |
18 | } | |
19 | ||
404e2e36 | 20 | require_once "autoload.php"; |
5f0a3741 | 21 | require_once "sessions.php"; |
23419d11 | 22 | require_once "functions.php"; |
e0d91d84 AD |
23 | require_once "sanity_check.php"; |
24 | require_once "config.php"; | |
25 | require_once "db.php"; | |
26 | require_once "db-prefs.php"; | |
27 | ||
e0d91d84 AD |
28 | startup_gettext(); |
29 | ||
1ebf3b97 | 30 | $script_started = microtime(true); |
e0d91d84 | 31 | |
6322ac79 | 32 | if (!init_plugins()) return; |
5f0a3741 | 33 | |
6a79e8af | 34 | if (ENABLE_GZIP_OUTPUT && function_exists("ob_gzhandler")) { |
5f0a3741 | 35 | ob_start("ob_gzhandler"); |
e0d91d84 AD |
36 | } |
37 | ||
5f0a3741 | 38 | $method = $_REQUEST["op"]; |
e0d91d84 | 39 | |
1ffe3391 | 40 | $override = PluginHost::getInstance()->lookup_handler("public", $method); |
e0d91d84 | 41 | |
8dcb2b47 AD |
42 | if ($override) { |
43 | $handler = $override; | |
44 | } else { | |
1f294435 | 45 | $handler = new Handler_Public($_REQUEST); |
8dcb2b47 AD |
46 | } |
47 | ||
48 | if (implements_interface($handler, "IHandler") && $handler->before($method)) { | |
de8260cb AD |
49 | if ($method && method_exists($handler, $method)) { |
50 | $handler->$method(); | |
51 | } else if (method_exists($handler, 'index')) { | |
52 | $handler->index(); | |
5f0a3741 | 53 | } |
de8260cb AD |
54 | $handler->after(); |
55 | return; | |
e0d91d84 AD |
56 | } |
57 | ||
5f0a3741 AD |
58 | header("Content-Type: text/plain"); |
59 | print json_encode(array("error" => array("code" => 7))); | |
e0d91d84 | 60 | |
e0d91d84 | 61 | ?> |