X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=public.php;h=33f5af75713df54fad835da2bed0c3085428a223;hb=0d703c73bd27147c94e2c5a67eeb115f448fbd70;hp=3b0d064b6c093ecc5c6311cc7b42ef65cd00b786;hpb=94976024848e94f2e1987b82b0b1d0d4140a416d;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); ?>