diff --git a/htdocs/batch_process.php b/htdocs/batch_process.php index d306836..9194f41 100644 --- a/htdocs/batch_process.php +++ b/htdocs/batch_process.php @@ -61,5 +61,5 @@ rrmdir(ReportParser::getWorkPath()); if ($nr) { - IRCNotify::send("#SingularityViewer", "[CrashProcessor] $nr new crash reports. http://crash.singularityviewer.org/crashes.php "); + IRCNotify::send("#SingularityViewer", "[CrashProcessor] $nr new reports. http://crash.singularityviewer.org/crashes.php "); } \ No newline at end of file diff --git a/htdocs/download.php b/htdocs/download.php new file mode 100644 index 0000000..25d9253 --- /dev/null +++ b/htdocs/download.php @@ -0,0 +1,17 @@ +requireUser(); + +$r = ReportParser::parse((int)$_GET["report_id"]); + +$miniDump = $r["Minidump"]; +if (!$miniDump || !($miniDump->getData())) +{ + Layout::header(); + print "
No such report
"; + Layout::footer(); + return; +} + +http::sendDownload("singularity" . ((int)$_GET["report_id"]) . ".dmp", $miniDump->getData()); \ No newline at end of file diff --git a/htdocs/lib/ReportParser.php b/htdocs/lib/ReportParser.php index 73dee35..fa02044 100644 --- a/htdocs/lib/ReportParser.php +++ b/htdocs/lib/ReportParser.php @@ -41,7 +41,7 @@ class ReportParser $q = kl_str_sql("select * from raw_reports where report_id=!i", $id); if (!$res = $DB->query($q) OR !$row = $DB->fetchRow($res)) { - return new stdClass; + return array(); } $data = new stdClass; $DB->loadFromDbRow($data, $res, $row); diff --git a/htdocs/report_detail.php b/htdocs/report_detail.php index 3490294..739effe 100644 --- a/htdocs/report_detail.php +++ b/htdocs/report_detail.php @@ -69,6 +69,10 @@ Layout::header();