mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 03:15:56 +00:00
router: only allow functions without required parameters as handler methods
This commit is contained in:
@@ -32,7 +32,14 @@
|
||||
|
||||
if (implements_interface($handler, "IHandler") && $handler->before($method)) {
|
||||
if ($method && method_exists($handler, $method)) {
|
||||
$handler->$method();
|
||||
$reflection = new ReflectionMethod($handler, $method);
|
||||
|
||||
if ($reflection->getNumberOfRequiredParameters() == 0) {
|
||||
$handler->$method();
|
||||
} else {
|
||||
header("Content-Type: text/json");
|
||||
print error_json(6);
|
||||
}
|
||||
} else if (method_exists($handler, 'index')) {
|
||||
$handler->index();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user