summaryrefslogtreecommitdiffstats
path: root/usr/local/www/crash_reporter.php
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2011-02-07 22:17:36 -0500
committerScott Ullrich <sullrich@pfsense.org>2011-02-07 22:17:36 -0500
commit2988636c21099f285c8ac6be69c036b46042aaf8 (patch)
tree9a9fa999a1b715e9fe4c20f0e9724cefb7e86f8a /usr/local/www/crash_reporter.php
parent85c3229a577d77c39a7098a6dbd104da21355dbe (diff)
downloadpfsense-2988636c21099f285c8ac6be69c036b46042aaf8.zip
pfsense-2988636c21099f285c8ac6be69c036b46042aaf8.tar.gz
Limit file sizes to roughly 143k
Diffstat (limited to 'usr/local/www/crash_reporter.php')
-rwxr-xr-xusr/local/www/crash_reporter.php10
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);
}
OpenPOWER on IntegriCloud