CalAddress could be an email address
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 18 Aug 2014 12:36:59 +0000 (14:36 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 4 Sep 2014 09:26:41 +0000 (11:26 +0200)
... and should be used if this is the case

Change-Id: I312a6f3ef1fe1893209ac15ca0e5a204327d0f28
Reviewed-on: http://gerrit.tine20.com/customers/1009
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Calendar/Convert/Event/VCalendar/Abstract.php

index 5aae0f9..c3a2072 100644 (file)
@@ -721,12 +721,17 @@ class Calendar_Convert_Event_VCalendar_Abstract implements Tinebase_Convert_Inte
         if (!empty($calAddress['EMAIL'])) {
             $email = $calAddress['EMAIL']->getValue();
         } else {
-            if (!preg_match('/(?P<protocol>mailto:|urn:uuid:)(?P<email>.*)/i', $calAddress->getValue(), $matches)) {
-                if (Tinebase_Core::isLogLevel(Zend_Log::WARN)) 
-                    Tinebase_Core::getLogger()->warn(__METHOD__ . '::' . __LINE__ . ' invalid attendee provided: ' . $calAddress->getValue());
-                return null;
+            if (! preg_match('/(?P<protocol>mailto:|urn:uuid:)(?P<email>.*)/i', $calAddress->getValue(), $matches)) {
+                if (preg_match(Tinebase_Mail::EMAIL_ADDRESS_REGEXP, $calAddress->getValue())) {
+                    $email = $calAddress->getValue();
+                } else {
+                    if (Tinebase_Core::isLogLevel(Zend_Log::WARN)) 
+                        Tinebase_Core::getLogger()->warn(__METHOD__ . '::' . __LINE__ . ' invalid attendee provided: ' . $calAddress->getValue());
+                    return null;
+                }
+            } else {
+                $email = $matches['email'];
             }
-            $email = $matches['email'];
         }
         
         $fullName = isset($calAddress['CN']) ? $calAddress['CN']->getValue() : $email;