Skip to content

Commit

Permalink
Merge pull request #8727 from kenjis/fix-Toolbar-response-getBody
Browse files Browse the repository at this point in the history
fix: [DebugBar] TypeError in Toolbar
  • Loading branch information
kenjis authored Apr 9, 2024
2 parents 4d2b3fe + fb2980e commit 17ac8e6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions system/Debug/Toolbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ protected function roundTo(float $number, int $increments = 5): float
}

/**
* Prepare for debugging..
* Prepare for debugging.
*
* @return void
*/
Expand All @@ -378,6 +378,7 @@ public function prepare(?RequestInterface $request = null, ?ResponseInterface $r
$app = service('codeigniter');

$request ??= service('request');
/** @var ResponseInterface $response */
$response ??= service('response');

// Disable the toolbar for downloads
Expand Down Expand Up @@ -433,7 +434,7 @@ public function prepare(?RequestInterface $request = null, ?ResponseInterface $r
. $kintScript
. PHP_EOL;

if (str_contains($response->getBody(), '<head>')) {
if (str_contains((string) $response->getBody(), '<head>')) {
$response->setBody(
preg_replace(
'/<head>/',
Expand Down

0 comments on commit 17ac8e6

Please sign in to comment.