From 772ebe6a41e408965937bd55208a68a5e8dcd5bb Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Fri, 11 Jul 2014 11:34:11 +0000 Subject: [PATCH] improve (failsafe for non matching vartype personal (array instead of expected string)) imap_rfc822_write_address own fallback function --- phpgwapi/inc/common_functions.inc.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/phpgwapi/inc/common_functions.inc.php b/phpgwapi/inc/common_functions.inc.php index f1e9202e08..d703a46316 100755 --- a/phpgwapi/inc/common_functions.inc.php +++ b/phpgwapi/inc/common_functions.inc.php @@ -150,6 +150,12 @@ if (!function_exists('imap_rfc822_write_address')) */ 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 ($personal && !preg_match('/^[0-9A-Z -]*$/iu', $personal)) // but quoting is never wrong, so quote more then necessary {