mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 08:44:07 -04:00
Merge pull request #1286 from owncloud/ocs_api
Check that external api methods return instances of OC_OCS_Result
This commit is contained in:
commit
1dac2ba496
1 changed files with 3 additions and 0 deletions
|
|
@ -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');
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue