]> git.openstreetmap.org Git - chef.git/commitdiff
DMCA form: add Content-Type header to generated email
authorpolarbearing <polarbearing@users.noreply.github.com>
Tue, 24 Nov 2020 15:47:15 +0000 (16:47 +0100)
committerGitHub <noreply@github.com>
Tue, 24 Nov 2020 15:47:15 +0000 (16:47 +0100)
DMCA form mails lack a content-type header. Quite often non-latin, such as Persian, is filled in, typically in utf-8, which currently looks garbled in the receiving mail client.
This PR adds the same content-type that the html page uses itself, and is the most likely to be filled by the form users.

cookbooks/dmca/files/default/html/index.php

index d81deb70ac3913087141caa51b60065b485dbdcf..47e1afb064388f2c6858df365b942018e7fbd869 100644 (file)
@@ -12,7 +12,8 @@ function process_data ($values) {
         $email_body .= print_r($values, true);
         $reply_address = $values['name_first'].' '.$values['name_last'].' <'.$values['email'].'>';
         $email_body .= 'Formatted address: '.$reply_address."\n\n";
-        mail('dmca@osmfoundation.org','OSM Claim of Copyright Infringement', $email_body, 'From: OSMF Copyright Form <dmca@osmfoundation.org>', '-fdmca@osmfoundation.org');
+        $email_header = 'From: OSMF Copyright Form <dmca@osmfoundation.org>' . "\r\n" . 'Content-Type: text/plain; charset="utf-8"';
+        mail('dmca@osmfoundation.org','OSM Claim of Copyright Infringement', $email_body, $email_header, '-fdmca@osmfoundation.org');
 }
 ?>
 <!DOCTYPE html>