X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=public.php;h=33f5af75713df54fad835da2bed0c3085428a223;hb=9b1e591854b3b1baf7cced3757edefcf0f78e85d;hp=5fd9beabdfb6c5bb425f68453d6a44bfc9063b9d;hpb=f30ef1fa1bd76b497b5c0a64a92e2e0ef7116515;p=tt-rss.git diff --git a/public.php b/public.php index 5fd9beab..33f5af75 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); + header("Content-Type: text/plain"); + print json_encode(array("error" => array("code" => 7))); - // We close the connection to database. - db_close($link); ?>