$report = ''; $report .= 'From: ' . $_POST['in']['handle'] . "\n"; $report .= 'Operating system: ' . $_POST['in']['php_os'] . "\n"; $report .= 'Package version: ' . $_POST['in']['package_version'] . "\n"; $report .= 'PHP version: ' . $_POST['in']['php_version'] . "\n"; $report .= 'Package: ' . $_POST['in']['package_name'] . "\n"; $report .= 'Bug Type: ' . $_POST['in']['bug_type'] . "\n"; $report .= 'Bug description: '; $fdesc = $fdesc; $sdesc = $_POST['in']['sdesc']; $ascii_report = "{$report}{$sdesc}\n\n" . wordwrap($fdesc); $ascii_report .= "\n-- \nEdit bug report at "; $ascii_report .= PEARWEB_PROTOCOL . PEAR_CHANNELNAME . "/bugs/bug.php?id={$cid}&edit="; include_once 'bugs/pear-bugs-utils.php'; $pbu = new PEAR_Bugs_Utils(); list($mailto, $mailfrom) = $pbu->getPackageMail($_POST['in']['package_name']); $email = $_POST['in']['email']; require_once 'bugs/pear-bugs-utils.php'; $protected_email = '"' . PEAR_Bugs_Utils::spamProtect($email, 'text') . '"'; $protected_email .= ' <' . $mailfrom . '>'; $extra_headers = 'From: ' . $protected_email . "\n"; $extra_headers .= 'X-PHP-BugTracker: PEARbug' . "\n"; $extra_headers .= 'X-PHP-Bug: ' . $cid . "\n"; $extra_headers .= 'X-PHP-Type: ' . $_POST['in']['bug_type'] . "\n"; $extra_headers .= 'X-PHP-PackageVersion: ' . $_POST['in']['package_version'] . "\n"; $extra_headers .= 'X-PHP-Version: ' . $_POST['in']['php_version'] . "\n"; $extra_headers .= 'X-PHP-Category: ' . $_POST['in']['package_name'] . "\n"; $extra_headers .= 'X-PHP-OS: ' . $_POST['in']['php_os'] . "\n"; $extra_headers .= 'X-PHP-Status: Open' . "\n"; $extra_headers .= 'Message-ID: <bug-' . $cid . '@' . PEAR_CHANNELNAME . '>'; $type = @$types[$_POST['in']['bug_type']];
function sendBugEmail($buginfo) { $report = ''; $report .= 'From: ' . $this->handle . "\n"; $report .= 'Operating system: ' . $buginfo['php_os'] . "\n"; $report .= 'Package version: ' . $buginfo['package_version'] . "\n"; $report .= 'PHP version: ' . $buginfo['php_version'] . "\n"; $report .= 'Package: ' . $buginfo['package_name'] . "\n"; $report .= 'Bug Type: ' . $buginfo['bug_type'] . "\n"; $report .= 'Bug description: '; $fdesc = $buginfo['ldesc']; $sdesc = $buginfo['sdesc']; $ascii_report = "{$report}{$sdesc}\n\n" . wordwrap($fdesc); $ascii_report .= "\n-- \nEdit bug report at "; $ascii_report .= "http://" . PEAR_CHANNELNAME . "/bugs/bug.php?id={$buginfo['id']}&edit="; include_once 'bugs/pear-bugs-utils.php'; $pbu = new PEAR_Bugs_Utils(); list($mailto, $mailfrom) = $pbu->getPackageMail($buginfo['package_name']); $email = $this->email; $protected_email = '"' . $pbu->spamProtect($email, 'text') . '"'; $protected_email .= '<' . $mailfrom . '>'; if ((!isset($email) || !isset($mailfrom)) && isset($buginfo['reporter_name'])) { $protected_email = '"' . $buginfo['reporter_name'] . '" <' . $pbu->spamProtect($buginfo['email']) . '>'; } $extra_headers = 'From: ' . $protected_email . "\n"; $extra_headers .= 'X-PHP-BugTracker: PEARbug' . "\n"; $extra_headers .= 'X-PHP-Bug: ' . $buginfo['id'] . "\n"; $extra_headers .= 'X-PHP-Type: ' . $buginfo['bug_type'] . "\n"; $extra_headers .= 'X-PHP-PackageVersion: ' . $buginfo['package_version'] . "\n"; $extra_headers .= 'X-PHP-Version: ' . $buginfo['php_version'] . "\n"; $extra_headers .= 'X-PHP-Category: ' . $buginfo['package_name'] . "\n"; $extra_headers .= 'X-PHP-OS: ' . $buginfo['php_os'] . "\n"; $extra_headers .= 'X-PHP-Status: Open' . "\n"; $extra_headers .= 'Message-ID: <bug-' . $buginfo['id'] . '@' . PEAR_CHANNELNAME . '>'; $types = array('Bug' => 'Bug', 'Feature/Change Request' => 'Req', 'Documentation Problem' => 'Doc'); $type = @$types[$buginfo['bug_type']]; if (!DEVBOX) { // mail to package developers @mail($mailto, "[PEAR-BUG] {$buginfo['bug_type']} #{$buginfo['id']} [NEW]: {$sdesc}", $ascii_report . "1\n-- \n", $extra_headers, '-f ' . PEAR_BOUNCE_EMAIL); // mail to reporter @mail($email, "[PEAR-BUG] {$buginfo['bug_type']} #{$buginfo['id']}: {$sdesc}", $ascii_report . "2\n", "From: " . PEAR_CHANNELNAME . " Bug Database <{$mailfrom}>\n" . "X-PHP-Bug: {$buginfo['id']}\n" . "Message-ID: <bug-{$buginfo['id']}@" . PEAR_CHANNELNAME . ">", '-f ' . PEAR_BOUNCE_EMAIL); } }