]>
git.wh0rd.org - tt-rss.git/blob - public.php
2cec82962b786a6f75b544d3b0da52520f9e5fcb
2 set_include_path(get_include_path() . PATH_SEPARATOR
. "include");
4 /* remove ill effects of magic quotes */
6 if (get_magic_quotes_gpc()) {
7 function stripslashes_deep($value) {
8 $value = is_array($value) ?
9 array_map('stripslashes_deep', $value) : stripslashes($value);
13 $_POST = array_map('stripslashes_deep', $_POST);
14 $_GET = array_map('stripslashes_deep', $_GET);
15 $_COOKIE = array_map('stripslashes_deep', $_COOKIE);
16 $_REQUEST = array_map('stripslashes_deep', $_REQUEST);
19 require_once "functions.php";
20 require_once "sessions.php";
21 require_once "sanity_check.php";
22 require_once "config.php";
23 require_once "db.php";
24 require_once "db-prefs.php";
26 no_cache_incantation();
30 $script_started = getmicrotime();
32 $link = db_connect(DB_HOST
, DB_USER
, DB_PASS
, DB_NAME
);
34 if (!init_connection($link)) return;
36 if (ENABLE_GZIP_OUTPUT
) {
37 ob_start("ob_gzhandler");
40 function __autoload($class) {
41 $file = "classes/".strtolower(basename($class)).".php";
42 if (file_exists($file)) {
47 $method = $_REQUEST["op"];
49 $handler = new Public_Handler($link, $_REQUEST);
52 if ($handler->before()) {
53 if ($method && method_exists($handler, $method)) {
55 } else if (method_exists($handler, 'index')) {
63 header("Content-Type: text/plain");
64 print json_encode(array("error" => array("code" => 7)));
66 // We close the connection to database.