From f1a9d2c1862825e68ec1c3dc96be75491ca08ac8 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Fri, 27 Dec 2019 20:01:57 +0100 Subject: [PATCH] BlueScreen: clickable classes in exception message --- src/Tracy/BlueScreen/BlueScreen.php | 9 +++++++++ src/Tracy/BlueScreen/assets/bluescreen.css | 8 ++++++-- src/Tracy/BlueScreen/assets/content.phtml | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/Tracy/BlueScreen/BlueScreen.php b/src/Tracy/BlueScreen/BlueScreen.php index d414f0df6..809beea12 100644 --- a/src/Tracy/BlueScreen/BlueScreen.php +++ b/src/Tracy/BlueScreen/BlueScreen.php @@ -120,6 +120,15 @@ private function renderTemplate(\Throwable $exception, string $template, $toScre '$0', $messageHtml ); + $messageHtml = preg_replace_callback( + '#\w+\\\\[\w\\\\]+\w#', + function ($m) { + return class_exists($m[0], false) || interface_exists($m[0], false) + ? '' . $m[0] . '' + : $m[0]; + }, + $messageHtml + ); $info = array_filter($this->info); $source = Helpers::getSource(); diff --git a/src/Tracy/BlueScreen/assets/bluescreen.css b/src/Tracy/BlueScreen/assets/bluescreen.css index 8afa1896d..cdf8bfcea 100644 --- a/src/Tracy/BlueScreen/assets/bluescreen.css +++ b/src/Tracy/BlueScreen/assets/bluescreen.css @@ -57,17 +57,21 @@ } #tracy-bs-error a { + border-bottom-color: rgba(255, 255, 255, .3) !important; +} + +#tracy-bs-error a.action { color: white !important; opacity: 0; font-size: .7em; border-bottom: none !important; } -#tracy-bs-error:hover a { +#tracy-bs-error:hover a.action { opacity: .6; } -#tracy-bs-error a:hover { +#tracy-bs-error a.action:hover { opacity: 1; } diff --git a/src/Tracy/BlueScreen/assets/content.phtml b/src/Tracy/BlueScreen/assets/content.phtml index 46ef4adbb..52db92a2a 100644 --- a/src/Tracy/BlueScreen/assets/content.phtml +++ b/src/Tracy/BlueScreen/assets/content.phtml @@ -34,7 +34,7 @@ $code = $exception->getCode() ? ' #' . $exception->getCode() : '';

- > + >