diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-11-02 09:39:56 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-11-02 09:39:56 +0000 |
| commit | 504df0f3c0b2953e2dbd0f5f3cffdccedb5be989 (patch) | |
| tree | 3527c7329fd41249f1fc5b23e053a0f259bbb75c /plugins | |
| parent | 847060fb5a85af8581910c694965c136c677a621 (diff) | |
- Handle multi-address fields from squirrel and add email format checking (#1487096)
git-svn-id: https://svn.roundcube.net/trunk@4167 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/squirrelmail_usercopy/squirrelmail_usercopy.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php b/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php index 82db3320e..5d7cc012e 100644 --- a/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php +++ b/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php @@ -70,8 +70,14 @@ class squirrelmail_usercopy extends rcube_plugin // copy address book $contacts = $rcmail->get_address_book(null, true); if ($contacts && count($this->abook)) { - foreach ($this->abook as $rec) - $contacts->insert($rec, true); + foreach ($this->abook as $rec) { + // #1487096 handle multi-address and/or too long items + $rec['email'] = array_shift(explode(';', $rec['email'])); + if (check_email(idn_to_ascii($rec['email']))) { + $rec['email'] = idn_to_utf8($rec['email']); + $contacts->insert($rec, true); + } + } } // mark identity as complete for following hooks |
