From: Tim Düsterhus Date: Tue, 23 Jun 2020 14:17:56 +0000 (+0200) Subject: Add stackHash to ExceptionLogUtil X-Git-Tag: 5.3.0_Alpha_1~191^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c3362304e35506d3328965d97830befabb08e2c9;p=GitHub%2FWoltLab%2FWCF.git Add stackHash to ExceptionLogUtil --- 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;