From c3362304e35506d3328965d97830befabb08e2c9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Jun 2020 16:17:56 +0200 Subject: [PATCH] Add stackHash to ExceptionLogUtil --- .../install/files/lib/util/ExceptionLogUtil.class.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/util/ExceptionLogUtil.class.php b/wcfsetup/install/files/lib/util/ExceptionLogUtil.class.php index 2318f78e25..90145409f0 100644 --- a/wcfsetup/install/files/lib/util/ExceptionLogUtil.class.php +++ b/wcfsetup/install/files/lib/util/ExceptionLogUtil.class.php @@ -3,7 +3,7 @@ namespace wcf\util; use wcf\system\Regex; /** - * Contains header-related functions. + * Contains helper functions to process the Exception log. * * @author Tim Duesterhus * @copyright 2001-2019 WoltLab GmbH @@ -83,6 +83,14 @@ final class ExceptionLogUtil { return $item; }, $chainRegex->getMatches()); + $matches['stackHash'] = sha1(implode("\0", array_map(function ($item) { + $result = ""; + foreach ($item['stack'] as $stack) { + $result .= $stack['file']."\t".$stack['line']."\t".$stack['class'].$stack['type'].$stack['function']."\n"; + } + return $result; + }, $chainMatches))); + $matches['date'] = strtotime($matches['date']); $matches['chain'] = $chainMatches; -- 2.20.1