diff --git a/core/dispatch.php b/core/dispatch.php index 7f04a15664b..86b810500a6 100644 --- a/core/dispatch.php +++ b/core/dispatch.php @@ -35,9 +35,7 @@ $controller->init(); $response = $controller->dispatch(); - if (is_array($response)) { - var_export($response); - } elseif (!is_null($response)) { + if (!is_null($response)) { echo $response; } } catch (Exception $ex) { diff --git a/plugins/API/Controller.php b/plugins/API/Controller.php index 18e39d58a2f..d11f953704f 100644 --- a/plugins/API/Controller.php +++ b/plugins/API/Controller.php @@ -30,7 +30,13 @@ function index() } $request = new Request('token_auth=' . Common::getRequestVar('token_auth', 'anonymous', 'string')); - return $request->process(); + $response = $request->process(); + + if (is_array($response)) { + $response = var_export($response, true); + } + + return $response; } public function listAllMethods()