diff --git a/modules/backend/classes/Controller.php b/modules/backend/classes/Controller.php index 747e2e8d4..35426d156 100644 --- a/modules/backend/classes/Controller.php +++ b/modules/backend/classes/Controller.php @@ -449,16 +449,16 @@ class Controller extends Extendable /* * If the handler returned an array, we should add it to output for rendering. - * If it is a scalar, add it to the array with the key "result". - * Otherwise, pass it to Laravel as a response object. + * If it is a string, add it to the array with the key "result". + * If an object, pass it to Laravel as a response object. */ if (is_array($result)) { $responseContents = array_merge($responseContents, $result); } - elseif (is_scalar($result)) { + elseif (is_string($result)) { $responseContents['result'] = $result; } - elseif ($result !== null) { + elseif (is_object($result)) { return $result; } diff --git a/modules/cms/classes/Controller.php b/modules/cms/classes/Controller.php index c10595084..3c2b5a255 100644 --- a/modules/cms/classes/Controller.php +++ b/modules/cms/classes/Controller.php @@ -648,16 +648,16 @@ class Controller /* * If the handler returned an array, we should add it to output for rendering. - * If it is a scalar, add it to the array with the key "result". - * Otherwise, pass it to Laravel as a response object. + * If it is a string, add it to the array with the key "result". + * If an object, pass it to Laravel as a response object. */ if (is_array($result)) { $responseContents = array_merge($responseContents, $result); } - elseif (is_scalar($result)) { + elseif (is_string($result)) { $responseContents['result'] = $result; } - elseif ($result !== null) { + elseif (is_object($result)) { return $result; }