use wcf\system\WCF;
use wcf\util\DirectoryUtil;
use wcf\util\StringUtil;
+use wcf\util\JSON;
/**
* Shows the exception log.
"Error Code: (?P<code>\d+)\s*\n".
"File: (?P<file>.*?) \((?P<line>\d+)\)\s*\n".
"Extra Information: (?P<information>(?:-|[a-zA-Z0-9+/]+={0,2}))\s*\n".
-"Stack Trace: (?P<stack>[a-zA-Z0-9+/]+={0,2})", Regex::DOT_ALL);
+"Stack Trace: (?P<stack>\[[^\n]+\])", Regex::DOT_ALL);
$isPhp7 = version_compare(PHP_VERSION, '7.0.0') >= 0;
foreach ($this->exceptions as $key => $val) {
}
}
- if ($isPhp7) {
- $item['stack'] = unserialize(base64_decode($item['stack']), ['allowed_classes' => false]);
- }
- else {
- $item['stack'] = unserialize(base64_decode($item['stack']));
- }
+ $item['stack'] = JSON::decode($item['stack']);
return $item;
}, $chainRegex->getMatches());
'Error Code: '.intval($e->getCode())."\n".
'File: '.str_replace("\n", ' ', $e->getFile()).' ('.$e->getLine().')'."\n".
'Extra Information: '.($e instanceof IExtraInformationException ? base64_encode(serialize($e->getExtraInformation())) : '-')."\n".
- 'Stack Trace: '.base64_encode(serialize(array_map(function ($item) {
+ 'Stack Trace: '.json_encode(array_map(function ($item) {
$item['args'] = array_map(function ($item) {
switch (gettype($item)) {
case 'object':
}, $item['args']);
return $item;
- }, sanitizeStacktrace($e, true))))."\n";
+ }, sanitizeStacktrace($e, true)))."\n";
}
while ($e = $e->getPrevious());