diff options
Diffstat (limited to 'modules/rest/controllers/rest.php')
-rw-r--r-- | modules/rest/controllers/rest.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/rest/controllers/rest.php b/modules/rest/controllers/rest.php index bd03b334..b3d59e0f 100644 --- a/modules/rest/controllers/rest.php +++ b/modules/rest/controllers/rest.php @@ -69,7 +69,7 @@ class Rest_Controller extends Controller { $request->params = (object) $input->post(); if (isset($_FILES["file"])) { $request->file = upload::save("file"); - Event::add("system.shutdown", create_function("", "unlink(\"{$request->file}\");")); + system::delete_later($request->file); } break; } @@ -98,7 +98,7 @@ class Rest_Controller extends Controller { $handler_class = "{$function}_rest"; $handler_method = $request->method; - if (!method_exists($handler_class, $handler_method)) { + if (!class_exists($handler_class) || !method_exists($handler_class, $handler_method)) { throw new Rest_Exception("Bad Request", 400); } |