crashreporter, limit filesize for upload. closes https://github.com/opnsense/core/issues/1924

This commit is contained in:
Ad Schellevis 2017-11-12 19:21:39 +01:00
parent 4a46cc8830
commit 7e85ffa6c6

View File

@ -36,7 +36,8 @@ function upload_crash_report($files, $agent)
$counter = 0;
foreach ($files as $filename) {
if (is_link($filename) || $filename == '/var/crash/minfree.gz' || $filename == '/var/crash/bounds.gz') {
if (is_link($filename) || $filename == '/var/crash/minfree.gz' || $filename == '/var/crash/bounds.gz'
|| filesize($filename) > 2097152 ) {
continue;
}
$post["file{$counter}"] = curl_file_create($filename, "application/x-gzip", basename($filename));