summaryrefslogtreecommitdiffstats
path: root/lib/api.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-01-24 02:37:40 -0800
committerThomas Müller <thomas.mueller@tmit.eu>2013-01-24 02:37:40 -0800
commit1dac2ba496a0054e9d5383a6babe7401dd2a260c (patch)
tree4b7cca4e20b02ecf38c7c40473d3f45f68c1a4c1 /lib/api.php
parentf9a9fc5670505c4b3af9ca7b1294730e00330a3b (diff)
parent8f9d3cd01d9cf253b88ac360c291bf361514742a (diff)
downloadnextcloud-server-1dac2ba496a0054e9d5383a6babe7401dd2a260c.tar.gz
nextcloud-server-1dac2ba496a0054e9d5383a6babe7401dd2a260c.zip
Merge pull request #1286 from owncloud/ocs_api
Check that external api methods return instances of OC_OCS_Result
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 0fce109a423..545b55757ff 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');
}