- fixes for proper handling of email addresses with form: "user"@domain.tld
| | |
| | | foreach ($a as $val) |
| | | { |
| | | $j++; |
| | | $address = $val['address']; |
| | | $name = preg_replace(array('/^[\'"]/', '/[\'"]$/'), '', trim($val['name'])); |
| | | $address = trim($val['address']); |
| | | $name = trim($val['name']); |
| | | |
| | | if (preg_match('/^[\'"]/', $name) && preg_match('/[\'"]$/', $name)) |
| | | $name = preg_replace(array('/^[\'"]/', '/[\'"]$/'), '', $name); |
| | | |
| | | if ($name && $address && $name != $address) |
| | | $string = sprintf('%s <%s>', preg_match("/$special_chars/", $name) ? '"'.addcslashes($name, '"').'"' : $name, $address); |
| | | else if ($address) |
| | |
| | | $out[$j] = array('name' => $name, |
| | | 'mailto' => $address, |
| | | 'string' => $string); |
| | | |
| | | |
| | | if ($max && $j==$max) |
| | | break; |
| | | } |
| | |
| | | |
| | | $addresses = array(); |
| | | $recipients = rcube_explode_quoted_string(',', $recipients); |
| | | |
| | | |
| | | reset($recipients); |
| | | while (list($k, $recipient) = each($recipients)) |
| | | { |
| | | $a = explode(" ", $recipient); |
| | | while (list($k2, $word) = each($a)) |
| | | { |
| | | if ((strpos($word, "@") > 0) && (strpos($word, "\"")===false)) |
| | | if (strpos($word, "@") > 0 && $word[strlen($word)-1] != '"') |
| | | { |
| | | $word = preg_replace('/^<|>$/', '', trim($word)); |
| | | if (in_array($word, $addresses)===false) |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | ?> |
| | |
| | | if ($got_writable_abook === null && $books = $RCMAIL->get_address_sources(true)) { |
| | | $got_writable_abook = true; |
| | | } |
| | | |
| | | |
| | | foreach ($a_parts as $part) { |
| | | $j++; |
| | | if ($PRINT_MODE) { |