X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=public.php;h=7aebde78f378c7f1012cf122f2a727b878b9eb1f;hb=e2b8c9273e09091c235959c25d8e4d8122aa6ca8;hp=c2de2185fd0cd6c91861cf5c278ef5c18d6849c8;hpb=e0d91d846dd5ac42a95a0832777cc76aaf579bc2;p=tt-rss.git diff --git a/public.php b/public.php index c2de2185..7aebde78 100644 --- a/public.php +++ b/public.php @@ -1,4 +1,7 @@ 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); - - // We close the connection to database. - db_close($link); + header("Content-Type: text/plain"); + print error_json(13); ?>