mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Trying to submit a symlink as part of crash reports will cause a failed
submission. Remove symlinks first. Also properly set user agent while here, consistent with others. Fix some style and whitespace too. Ticket
This commit is contained in:
parent
26b94b874f
commit
bc28e0e4b2
@ -53,15 +53,15 @@ function upload_crash_report($files) {
|
||||
$post["file{$counter}"] = "@{$file}";
|
||||
$counter++;
|
||||
}
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||
curl_setopt($ch, CURLOPT_VERBOSE, 0);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)");
|
||||
curl_setopt($ch, CURLOPT_URL, $g['crashreporterurl']);
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
|
||||
$response = curl_exec($ch);
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||
curl_setopt($ch, CURLOPT_VERBOSE, 0);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . rtrim(file_get_contents("/etc/version")));
|
||||
curl_setopt($ch, CURLOPT_URL, $g['crashreporterurl']);
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
|
||||
$response = curl_exec($ch);
|
||||
return $response;
|
||||
}
|
||||
|
||||
@ -101,8 +101,10 @@ exec("/usr/bin/grep -vi warning /tmp/PHP_errors.log", $php_errors);
|
||||
if (!is_dir("/var/crash"))
|
||||
mkdir("/var/crash", 0750, true);
|
||||
@file_put_contents("/var/crash/crashreport_header.txt", $crash_report_header);
|
||||
if(file_exists("/tmp/PHP_errors.log"))
|
||||
if(file_exists("/tmp/PHP_errors.log")) {
|
||||
copy("/tmp/PHP_errors.log", "/var/crash/PHP_errors.log");
|
||||
}
|
||||
exec("find /var/crash -type l -exec rm {} +");
|
||||
exec("/usr/bin/gzip /var/crash/*");
|
||||
$files_to_upload = glob("/var/crash/*");
|
||||
echo "<br/>";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user