From: Tim Düsterhus Date: Sat, 19 Jul 2014 13:29:51 +0000 (+0200) Subject: Fix ExceptionLogViewPage erroring out when passed invalid logfile X-Git-Tag: 2.1.0_Alpha_1~552 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2711ca8c3c39b9dac3210238c2c86731e99b27b8;p=GitHub%2FWoltLab%2FWCF.git Fix ExceptionLogViewPage erroring out when passed invalid logfile Closes #1762 --- diff --git a/wcfsetup/install/files/lib/acp/page/ExceptionLogViewPage.class.php b/wcfsetup/install/files/lib/acp/page/ExceptionLogViewPage.class.php index 11ecfc76e7..a5b1be064e 100644 --- a/wcfsetup/install/files/lib/acp/page/ExceptionLogViewPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/ExceptionLogViewPage.class.php @@ -117,12 +117,18 @@ class ExceptionLogViewPage extends MultipleLinkPage { $contents = $split->split($contents, Regex::SPLIT_NON_EMPTY_ONLY | Regex::CAPTURE_SPLIT_DELIMITER); // even items become keys, odd items become values - $this->exceptions = call_user_func_array('array_merge', array_map( - function($v) { - return array($v[0] => $v[1]); - }, - array_chunk($contents, 2) - )); + try { + $this->exceptions = call_user_func_array('array_merge', array_map( + function($v) { + return array($v[0] => $v[1]); + }, + array_chunk($contents, 2) + )); + } + catch (\Exception $e) { + // logfile contents are pretty malformed, abort + return; + } if ($this->exceptionID) $this->searchPage($this->exceptionID); $this->calculateNumberOfPages();