From ef515f925acd4ae3fdcf417c5b834e6d4430eed6 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 8 Jun 2023 15:00:55 +0200 Subject: [PATCH] system: simplify/unify previous --- src/www/crash_reporter.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/www/crash_reporter.php b/src/www/crash_reporter.php index a04f179fa..93cbdbc42 100644 --- a/src/www/crash_reporter.php +++ b/src/www/crash_reporter.php @@ -144,10 +144,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { } if ($count || (!empty($desc) && !empty($email))) { $files_to_upload = glob('/var/crash/*'); - foreach ($files_to_upload as $key => $file) { - if (filesize($file) > 450000) { - unset($files_to_upload[$key]); - @unlink($file); + foreach ($files_to_upload as $file_to_upload) { + if (filesize($file_to_upload) > 450000) { + @unlink($file_to_upload); } } file_put_contents('/var/crash/crashreport_header.txt', $crash_report_header);