[Svn] r4167 - trunk/plugins/squirrelmail_usercopy

trac at roundcube.net trac at roundcube.net
Tue Nov 2 10:39:56 CET 2010


Author: alec
Date: 2010-11-02 04:39:56 -0500 (Tue, 02 Nov 2010)
New Revision: 4167

Modified:
   trunk/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php
Log:
- Handle multi-address fields from squirrel and add email format checking (#1487096)


Modified: trunk/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php
===================================================================
--- trunk/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php	2010-11-02 09:27:03 UTC (rev 4166)
+++ trunk/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php	2010-11-02 09:39:56 UTC (rev 4167)
@@ -70,8 +70,14 @@
 			// 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

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list