Commit 88f49954 authored by Franco Fichtner's avatar Franco Fichtner

crash reporter: be done with suhosin hiccups by filtering them

parent fb20b901
...@@ -655,14 +655,25 @@ function get_crash_report($pedantic = false) ...@@ -655,14 +655,25 @@ function get_crash_report($pedantic = false)
'</a>' '</a>'
); );
$skip_files = array('.', '..', 'minfree', 'bounds', ''); $skip_files = array('.', '..', 'minfree', 'bounds', '');
$PHP_errors_log = '/tmp/PHP_errors.log';
$excludes = array();
$count = 0; $count = 0;
if (file_exists('/tmp/PHP_errors.log')) { if (!$pedantic) {
if ($pedantic) { $excludes[] = 'PHP Notice:';
$total = `/usr/bin/wc -l /tmp/PHP_errors.log | /usr/bin/awk '{ print $1 }'`; $excludes[] = 'PHP Startup: Unable to load dynamic library \'/usr/local/lib/php/20131226/suhosin.so\' - /usr/local/lib/php/20131226/suhosin.so: Undefined symbol "ps_globals" in Unknown on line 0';
} else { }
$total = `/usr/bin/grep -v 'PHP Notice:' /tmp/PHP_errors.log | /usr/bin/wc -l | /usr/bin/awk '{ print $1 }'`;
if (file_exists($PHP_errors_log)) {
$extra = '';
foreach ($excludes as $exclude) {
$extra .= sprintf('/usr/bin/grep -v %s | ', escapeshellarg($exclude));
} }
$total = shell_exec(sprintf(
'/bin/cat %s | %s /usr/bin/wc -l | /usr/bin/awk \'{ print $1 }\'',
$PHP_errors_log,
$extra
));
if ($total > 0) { if ($total > 0) {
$count++; $count++;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment