Skip to content

Commit db2c0b3

Browse files
authored
Merge pull request #3804 from codeigniter4/toolbar-limit
Limit toolbar to initial head tag
2 parents 0143e49 + 863c264 commit db2c0b3

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

system/Debug/Toolbar.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,10 +395,7 @@ public function prepare(RequestInterface $request = null, ResponseInterface $res
395395

396396
if (strpos($response->getBody(), '<head>') !== false)
397397
{
398-
$response->setBody(
399-
str_replace('<head>', '<head>' . $script, $response->getBody())
400-
);
401-
398+
$response->setBody(preg_replace('<head>', '<head>' . $script, $response->getBody(), 1));
402399
return;
403400
}
404401

0 commit comments

Comments
 (0)