diff --git a/src/Commands/core/WatchdogCommands.php b/src/Commands/core/WatchdogCommands.php index 17ed7f130e..a450eac2dc 100644 --- a/src/Commands/core/WatchdogCommands.php +++ b/src/Commands/core/WatchdogCommands.php @@ -373,7 +373,9 @@ protected function formatResult(\stdClass $result, bool $extended = false): \std if (is_string($variables)) { $variables = unserialize($variables); } + $has_hidden_backtrace = false; if (is_array($variables)) { + $has_hidden_backtrace = !empty($variables['@backtrace_string']) && !str_contains($result->message, '@backtrace_string'); $result->message = strtr($result->message, $variables); } unset($result->variables); @@ -389,6 +391,10 @@ protected function formatResult(\stdClass $result, bool $extended = false): \std unset($result->referer); } $message_length = PHP_INT_MAX; + + if ($has_hidden_backtrace) { + $result->backtrace = $variables['@backtrace_string']; + } } $result->message = Unicode::truncate(strip_tags(Html::decodeEntities($result->message)), $message_length);