Issue ID 0000407: accents are not allowed in mail headers

Merge BSF r1360:1361 into branch-1_6






git-svn-id: http://piwigo.org/svn/branches/branch-1_6@1362 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
rub
2006-06-17 23:02:59 +00:00
parent 43835fac8d
commit 9ab183d3e4
4 changed files with 543 additions and 4 deletions
+8 -4
View File
@@ -78,13 +78,15 @@ function get_mail_configuration()
*/
function format_email($name, $email)
{
$cvt7b_name = str_translate_to_ascii7bits($name);
if (strpos($email, '<') === false)
{
return $name.' <'.$email.'>';
return $cvt7b_name.' <'.$email.'>';
}
else
{
return $name.$email;
return $cvt7b_name.$email;
}
}
@@ -95,6 +97,8 @@ function pwg_mail($to, $from = '', $subject = 'PhpWebGallery', $infos = '')
{
global $conf, $conf_mail;
$cvt7b_subject = str_translate_to_ascii7bits($subject);
if (!isset($conf_mail))
{
$conf_mail = get_mail_configuration();
@@ -126,11 +130,11 @@ function pwg_mail($to, $from = '', $subject = 'PhpWebGallery', $infos = '')
{
$options = '-f '.$from;
return mail($to, $subject, $content, $headers, $options);
return mail($to, $cvt7b_subject, $content, $headers, $options);
}
else
{
return mail($to, $subject, $content, $headers);
return mail($to, $cvt7b_subject, $content, $headers);
}
}