Skip to content
Snippets Groups Projects
Commit f790bf5c authored by Olav Morken's avatar Olav Morken
Browse files

Error reporting: Add Reply-To header with the users email address to submittted error reports.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@768 44740490-163a-0410-bde0-09ae8108e29a
parent 31abe582
No related branches found
No related tags found
No related merge requests found
...@@ -102,6 +102,16 @@ $message .= "where this report was sent.\n"; ...@@ -102,6 +102,16 @@ $message .= "where this report was sent.\n";
$headers = 'MIME-Version: 1.0' . "\r\n"; $headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-Type: text/plain; charset="UTF-8"' . "\r\n"; $headers .= 'Content-Type: text/plain; charset="UTF-8"' . "\r\n";
/* Add the email address of the submitter as the Reply-To address. */
if(array_key_exists('email', $_POST)) {
$email = $_POST['email'];
$email = trim($email);
/* Check that it looks like a valid email address. */
if(!preg_match('/\s/', $email) && strpos($email, '@') !== FALSE) {
$headers .= 'Reply-To: ' . $email . "\r\n";
}
}
/* Send the email. */ /* Send the email. */
$email = $config->getValue('technicalcontact_email', 'na@example.org'); $email = $config->getValue('technicalcontact_email', 'na@example.org');
if($email !== 'na@example.org') { if($email !== 'na@example.org') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment