diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2011-02-07 22:17:36 -0500 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2011-02-07 22:17:36 -0500 |
commit | 2988636c21099f285c8ac6be69c036b46042aaf8 (patch) | |
tree | 9a9fa999a1b715e9fe4c20f0e9724cefb7e86f8a | |
parent | 85c3229a577d77c39a7098a6dbd104da21355dbe (diff) | |
download | pfsense-2988636c21099f285c8ac6be69c036b46042aaf8.zip pfsense-2988636c21099f285c8ac6be69c036b46042aaf8.tar.gz |
Limit file sizes to roughly 143k
-rwxr-xr-x | usr/local/www/crash_reporter.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr/local/www/crash_reporter.php b/usr/local/www/crash_reporter.php index 1599e0b..208dafb 100755 --- a/usr/local/www/crash_reporter.php +++ b/usr/local/www/crash_reporter.php @@ -42,13 +42,17 @@ require("guiconfig.inc"); require("functions.inc"); require("captiveportal.inc"); +define("FILE_SIZE", 150000); + function upload_crash_report($files) { global $g; $post = array(); $counter = 0; foreach($files as $file) { - $post["file{$counter}"] = "@{$file}"; - $counter++; + if(filesize($cf) < FILE_SIZE) { + $post["file{$counter}"] = "@{$file}"; + $counter++; + } } $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, 0); @@ -121,7 +125,7 @@ $crash_report_header .= "\nCrash report details:\n"; $crash_reports .= $crash_report_header; if(is_array($crash_files)) { foreach($crash_files as $cf) { - if(filesize($cf) < 150000) { + if(filesize($cf) < FILE_SIZE) { $crash_reports .= "\nFilename: {$cf}\n"; $crash_reports .= file_get_contents($cf); } |