diff --git a/system/Debug/Toolbar.php b/system/Debug/Toolbar.php index 452f3484677b..9c45dd16938c 100644 --- a/system/Debug/Toolbar.php +++ b/system/Debug/Toolbar.php @@ -22,6 +22,7 @@ use CodeIgniter\HTTP\ResponseInterface; use Config\Services; use Config\Toolbar as ToolbarConfig; +use Kint\Kint; /** * Debug Toolbar @@ -109,7 +110,26 @@ public function run(float $startTime, float $totalTime, RequestInterface $reques { foreach ($items as $key => $value) { - $varData[esc($key)] = is_string($value) ? esc($value) : '
' . esc(print_r($value, true)) . '
'; + if (is_string($value)) + { + $varData[esc($key)] = esc($value); + } + else + { + $oldKintMode = Kint::$mode_default; + $oldKintCalledFrom = Kint::$display_called_from; + + Kint::$mode_default = Kint::MODE_RICH; + Kint::$display_called_from = false; + + $kint = @Kint::dump($value); + $kint = substr($kint, strpos($kint, '') + 8 ); + + Kint::$mode_default = $oldKintMode; + Kint::$display_called_from = $oldKintCalledFrom; + + $varData[esc($key)] = $kint; + } } } @@ -343,12 +363,19 @@ public function prepare(RequestInterface $request = null, ResponseInterface $res return; } + $oldKintMode = Kint::$mode_default; + Kint::$mode_default = Kint::MODE_RICH; + $kintScript = @Kint::dump(''); + Kint::$mode_default = $oldKintMode; + $kintScript = substr($kintScript, 0, strpos($kintScript, '') + 8 ); + $script = PHP_EOL . '' . '' . '' + . $kintScript . PHP_EOL; if (strpos($response->getBody(), '') !== false)