| @@ 159-162 (lines=4) @@ | ||
| 156 | if (is_array($personal)) $personal = implode(' ', $personal); |
|
| 157 | ||
| 158 | //if (!preg_match('/^[!#$%&\'*+/0-9=?A-Z^_`a-z{|}~-]+$/u', $personal)) // that's how I read the rfc(2)822 |
|
| 159 | if ($personal && !preg_match('/^[0-9A-Z -]*$/iu', $personal)) // but quoting is never wrong, so quote more then necessary |
|
| 160 | { |
|
| 161 | $personal = '"'.str_replace(array('\\', '"'),array('\\\\', '\\"'), $personal).'"'; |
|
| 162 | } |
|
| 163 | return ($personal ? $personal.' <' : '').$mailbox.($host ? '@'.$host : '').($personal ? '>' : ''); |
|
| 164 | } |
|
| 165 | } |
|
| @@ 250-253 (lines=4) @@ | ||
| 247 | if (is_string($address) && !empty($personal)) |
|
| 248 | { |
|
| 249 | //if (!preg_match('/^[!#$%&\'*+/0-9=?A-Z^_`a-z{|}~-]+$/u', $personal)) // that's how I read the rfc(2)822 |
|
| 250 | if ($personal && !preg_match('/^[0-9A-Z -]*$/iu', $personal)) // but quoting is never wrong, so quote more then necessary |
|
| 251 | { |
|
| 252 | $personal = '"'.str_replace(array('\\', '"'),array('\\\\', '\\"'), $personal).'"'; |
|
| 253 | } |
|
| 254 | $address = ($personal ? $personal.' <' : '').$address.($personal ? '>' : ''); |
|
| 255 | } |
|
| 256 | return $address; |
|