X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=public.php;h=33f5af75713df54fad835da2bed0c3085428a223;hb=89018afa13887c46de4c8ef8189fc7b500cdac0f;hp=2cec82962b786a6f75b544d3b0da52520f9e5fcb;hpb=5f0a3741d0a549849b503eca7b6d7b87d9903069;p=tt-rss.git diff --git a/public.php b/public.php index 2cec8296..33f5af75 100644 --- a/public.php +++ b/public.php @@ -1,5 +1,6 @@ lookup_handler("public", $method); + + if ($override) { + $handler = $override; + } else { + $handler = new Handler_Public($_REQUEST); + } - 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 (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); ?>