X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=public.php;h=33f5af75713df54fad835da2bed0c3085428a223;hb=fc1f0a6847c9c9fb4f265be85a3b66a5e4eb5b12;hp=3b0d064b6c093ecc5c6311cc7b42ef65cd00b786;hpb=3f3630529e1e7a0adf2ce0022596006cfcba0089;p=tt-rss.git diff --git a/public.php b/public.php index 3b0d064b..33f5af75 100644 --- a/public.php +++ b/public.php @@ -1,5 +1,6 @@ lookup_handler("public", $method); - if ((!$op || $op == "rss" || $op == "dlg") && !$_REQUEST["noxml"]) { - header("Content-Type: application/xml; charset=utf-8"); + if ($override) { + $handler = $override; } else { - header("Content-Type: text/plain; charset=utf-8"); + $handler = new Handler_Public($_REQUEST); } - if (ENABLE_GZIP_OUTPUT) { - ob_start("ob_gzhandler"); + if (implements_interface($handler, "IHandler") && $handler->before($method)) { + if ($method && method_exists($handler, $method)) { + $handler->$method(); + } else if (method_exists($handler, 'index')) { + $handler->index(); + } + $handler->after(); + return; } - handle_public_request($link, $op); + header("Content-Type: text/plain"); + print json_encode(array("error" => array("code" => 7))); - // We close the connection to database. - db_close($link); ?>