From: polarbearing Date: Tue, 24 Nov 2020 15:47:15 +0000 (+0100) Subject: DMCA form: add Content-Type header to generated email X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/9feb2672a73e40ba91d06f7e3b1a1313b020dd96 DMCA form: add Content-Type header to generated email 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. --- diff --git a/cookbooks/dmca/files/default/html/index.php b/cookbooks/dmca/files/default/html/index.php index d81deb70a..47e1afb06 100644 --- a/cookbooks/dmca/files/default/html/index.php +++ b/cookbooks/dmca/files/default/html/index.php @@ -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 ', '-fdmca@osmfoundation.org'); + $email_header = 'From: OSMF Copyright Form ' . "\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'); } ?>