Skip to content

Commit

Permalink
Merge pull request #6272 from kenjis/refactor-debug-toolbar
Browse files Browse the repository at this point in the history
refactor: debug toolbar
  • Loading branch information
samsonasik authored Jul 19, 2022
2 parents 6204896 + b9cdbdc commit 9d45712
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions system/Debug/Toolbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,7 @@ public function prepare(?RequestInterface $request = null, ?ResponseInterface $r
// for this response
if ($request->isAJAX() || strpos($format, 'html') === false) {
$response->setHeader('Debugbar-Time', "{$time}")
->setHeader('Debugbar-Link', site_url("?debugbar_time={$time}"))
->getBody();
->setHeader('Debugbar-Link', site_url("?debugbar_time={$time}"));

return;
}
Expand All @@ -419,7 +418,14 @@ public function prepare(?RequestInterface $request = null, ?ResponseInterface $r
. PHP_EOL;

if (strpos($response->getBody(), '<head>') !== false) {
$response->setBody(preg_replace('/<head>/', '<head>' . $script, $response->getBody(), 1));
$response->setBody(
preg_replace(
'/<head>/',
'<head>' . $script,
$response->getBody(),
1
)
);

return;
}
Expand Down

0 comments on commit 9d45712

Please sign in to comment.