thomascube
2008-03-21 0c6f4b88648879cf12342d16c83bdd0d3a11672f
program/include/main.inc
@@ -1567,7 +1567,10 @@
function format_email_recipient($email, $name='')
  {
  if ($name && $name != $email)
    return sprintf('%s <%s>', strpos($name, ",") ? '"'.$name.'"' : $name, $email);
    {
    // Special chars as defined by RFC 822 need to in quoted string (or escaped).
    return sprintf('%s <%s>', preg_match('/[\(\)\<\>\\\.\[\]@,;:"]/', $name) ? '"'.addcslashes($name, '"').'"' : $name, $email);
    }
  else
    return $email;
  }