mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ENH Improve scalar response handling
This resolves an issue where method_exists() was being called on scalar response values, which is not supported in PHP 8.
This commit is contained in:
parent
f00f64120d
commit
91f831cd0b
@ -230,7 +230,9 @@ class Controller extends RequestHandler implements TemplateGlobalProvider
|
|||||||
*/
|
*/
|
||||||
protected function prepareResponse($response)
|
protected function prepareResponse($response)
|
||||||
{
|
{
|
||||||
if ($response instanceof HTTPResponse) {
|
if (!is_object($response)) {
|
||||||
|
$this->getResponse()->setBody($response);
|
||||||
|
} elseif ($response instanceof HTTPResponse) {
|
||||||
if (isset($_REQUEST['debug_request'])) {
|
if (isset($_REQUEST['debug_request'])) {
|
||||||
$class = static::class;
|
$class = static::class;
|
||||||
Debug::message(
|
Debug::message(
|
||||||
|
Loading…
Reference in New Issue
Block a user