]>
git.wh0rd.org - tt-rss.git/blob - public.php
2 set_include_path(dirname(__FILE__
) ."/include" . PATH_SEPARATOR
.
5 /* remove ill effects of magic quotes */
7 if (get_magic_quotes_gpc()) {
8 function stripslashes_deep($value) {
9 $value = is_array($value) ?
10 array_map('stripslashes_deep', $value) : stripslashes($value);
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);
20 require_once "sessions.php";
21 require_once "functions.php";
22 require_once "sanity_check.php";
23 require_once "config.php";
24 require_once "db.php";
25 require_once "db-prefs.php";
27 no_cache_incantation();
31 $script_started = microtime(true);
33 $link = db_connect(DB_HOST
, DB_USER
, DB_PASS
, DB_NAME
);
35 if (!init_connection($link)) return;
37 if (ENABLE_GZIP_OUTPUT
&& function_exists("ob_gzhandler")) {
38 ob_start("ob_gzhandler");
41 $method = $_REQUEST["op"];
44 $override = $pluginhost->lookup_handler("public", $method);
49 $handler = new Handler_Public($link, $_REQUEST);
52 if (implements_interface($handler, "IHandler") && $handler->before($method)) {
53 if ($method && method_exists($handler, $method)) {
55 } else if (method_exists($handler, 'index')) {
62 header("Content-Type: text/plain");
63 print json_encode(array("error" => array("code" => 7)));
65 // We close the connection to database.