diff --git a/src/RunTracy/Helpers/Profiler/ProfilerService.php b/src/RunTracy/Helpers/Profiler/ProfilerService.php index 95899af..b4ec577 100644 --- a/src/RunTracy/Helpers/Profiler/ProfilerService.php +++ b/src/RunTracy/Helpers/Profiler/ProfilerService.php @@ -91,10 +91,10 @@ private function getMetaData() $profile->meta[Profiler::START_MEMORY_USAGE], $profile->meta[Profiler::FINISH_MEMORY_USAGE] ); - $this->metaData[self::META_TIME_LINE][$profile->meta[Profiler::START_TIME] * 1000] = [ + $this->metaData[self::META_TIME_LINE][(int)($profile->meta[Profiler::START_TIME] * 1000)] = [ self::META_TIME_LINE__MEMORY_USAGE => $profile->meta[Profiler::START_MEMORY_USAGE] ]; - $this->metaData[self::META_TIME_LINE][$profile->meta[Profiler::FINISH_TIME] * 1000] = [ + $this->metaData[self::META_TIME_LINE][(int)($profile->meta[Profiler::FINISH_TIME] * 1000)] = [ self::META_TIME_LINE__MEMORY_USAGE => $profile->meta[Profiler::FINISH_MEMORY_USAGE] ]; } diff --git a/src/RunTracy/Middlewares/TracyMiddleware.php b/src/RunTracy/Middlewares/TracyMiddleware.php index d508d49..775d798 100644 --- a/src/RunTracy/Middlewares/TracyMiddleware.php +++ b/src/RunTracy/Middlewares/TracyMiddleware.php @@ -58,7 +58,8 @@ public function __invoke(Request $request, Response $response, callable $next) { $res = $next($request, $response); - $cookies = json_decode($request->getCookieParam('tracyPanelsEnabled')); + $tracyPanelsEnabled = $request->getCookieParam('tracyPanelsEnabled'); + $cookies = $tracyPanelsEnabled ? json_decode($tracyPanelsEnabled) : []; if (!empty($cookies)) { $def = array_fill_keys(array_keys($this->defcfg), null); $cookies = array_fill_keys($cookies, 1); diff --git a/src/RunTracy/Templates/VendorVersionsPanel.phtml b/src/RunTracy/Templates/VendorVersionsPanel.phtml index f51efda..67e799e 100644 --- a/src/RunTracy/Templates/VendorVersionsPanel.phtml +++ b/src/RunTracy/Templates/VendorVersionsPanel.phtml @@ -3,7 +3,7 @@ use Tracy\Helpers; function h($str) { - return htmlspecialchars($str, ENT_QUOTES | ENT_HTML5, 'UTF-8'); + return htmlspecialchars((string)$str, ENT_QUOTES | ENT_HTML5, 'UTF-8'); } /**