summaryrefslogtreecommitdiff
path: root/public.php
diff options
context:
space:
mode:
Diffstat (limited to 'public.php')
-rw-r--r--public.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/public.php b/public.php
index e37c44172..36308e25e 100644
--- a/public.php
+++ b/public.php
@@ -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();
}