mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-04 20:40:14 +01:00
improve (failsafe for non matching vartype personal (array instead of expected string)) imap_rfc822_write_address own fallback function
This commit is contained in:
parent
a0bf45da93
commit
772ebe6a41
@ -150,6 +150,12 @@ if (!function_exists('imap_rfc822_write_address'))
|
|||||||
*/
|
*/
|
||||||
function imap_rfc822_write_address($mailbox, $host, $personal)
|
function imap_rfc822_write_address($mailbox, $host, $personal)
|
||||||
{
|
{
|
||||||
|
if (is_array($personal)) {
|
||||||
|
foreach ($personal as $e) {
|
||||||
|
$p .= ($p?' ':'').$e;
|
||||||
|
}
|
||||||
|
$personal = $p;
|
||||||
|
}
|
||||||
//if (!preg_match('/^[!#$%&\'*+/0-9=?A-Z^_`a-z{|}~-]+$/u', $personal)) // that's how I read the rfc(2)822
|
//if (!preg_match('/^[!#$%&\'*+/0-9=?A-Z^_`a-z{|}~-]+$/u', $personal)) // that's how I read the rfc(2)822
|
||||||
if ($personal && !preg_match('/^[0-9A-Z -]*$/iu', $personal)) // but quoting is never wrong, so quote more then necessary
|
if ($personal && !preg_match('/^[0-9A-Z -]*$/iu', $personal)) // but quoting is never wrong, so quote more then necessary
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user