X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=public.php;h=7aebde78f378c7f1012cf122f2a727b878b9eb1f;hb=e2b8c9273e09091c235959c25d8e4d8122aa6ca8;hp=2cec82962b786a6f75b544d3b0da52520f9e5fcb;hpb=5f0a3741d0a549849b503eca7b6d7b87d9903069;p=tt-rss.git diff --git a/public.php b/public.php index 2cec8296..7aebde78 100644 --- a/public.php +++ b/public.php @@ -1,5 +1,6 @@ lookup_handler("public", $method); - if ($handler) { - if ($handler->before()) { - if ($method && method_exists($handler, $method)) { - $handler->$method(); - } else if (method_exists($handler, 'index')) { - $handler->index(); - } - $handler->after(); - return; + if ($override) { + $handler = $override; + } else { + $handler = new Handler_Public($_REQUEST); + } + + 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; } header("Content-Type: text/plain"); - print json_encode(array("error" => array("code" => 7))); - - // We close the connection to database. - db_close($link); + print error_json(13); ?>