summaryrefslogtreecommitdiffstats
path: root/lib/api.php
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2013-01-16 21:46:00 +0000
committerTom Needham <needham.thomas@gmail.com>2013-01-16 21:46:00 +0000
commit9dc668740a20e2e5ab698b00c4286d8f6719db6e (patch)
treec65ecce0bd5ddcc3dd5980fd8274f101a8c033bb /lib/api.php
parent358671ac1d55f8304b1c1aae285e497ed512ce0c (diff)
downloadnextcloud-server-9dc668740a20e2e5ab698b00c4286d8f6719db6e.tar.gz
nextcloud-server-9dc668740a20e2e5ab698b00c4286d8f6719db6e.zip
Check that api methods return the correct result type
Diffstat (limited to 'lib/api.php')
-rw-r--r--lib/api.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/api.php b/lib/api.php
index e0097a7abf8..7722c744483 100644
--- a/lib/api.php
+++ b/lib/api.php
@@ -90,6 +90,9 @@ class OC_API {
if(self::isAuthorised(self::$actions[$name])) {
if(is_callable(self::$actions[$name]['action'])) {
$response = call_user_func(self::$actions[$name]['action'], $parameters);
+ if(!($response instanceof OC_OCS_Result)){
+ $response = new OC_OCS_Result(null, 996, 'Internal Server Error');
+ }
} else {
$response = new OC_OCS_Result(null, 998, 'Api method not found');
}