Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.32.0

Bug #5988 Contact_Vcard_Parse does not work with apple adressbook exported vcard files
Submitted: 2005-11-16 17:42 UTC
From: p dot a dot r dot a dot s dot e dot w at gmx dot net Assigned: cweiske
Status: Closed Package: Contact_Vcard_Parse
PHP Version: 5.1.0 OS: apple osx tiger 10.4.3
Roadmaps: (Not assigned)    
Subscription  


 [2005-11-16 17:42 UTC] p dot a dot r dot a dot s dot e dot w at gmx dot net
Description: ------------ find the file contents of a vcard exported by apple adressbook here: BEGIN:VCARD VERSION:3.0 N:Shagnasty;Bolivar;Odysseus;Mr.;III\,B.S. FN:Mr. Bolivar Odysseus Shagnasty III\,B.S. EMAIL;type=INTERNET;type=HOME;type=pref:boshag@example.com EMAIL;type=INTERNET;type=WORK:boshag@ciaweb.net item1.ADR;type=HOME;type=pref:;;123 Main\,Apartment 101;Beverly Hills;CA;90210; item1.X-ABADR:at item2.ADR;type=WORK:;;test1;test2;;111122222;test3 item2.X-ABADR:at X-ABUID:7D26C3AC-5F1F-422A-A156-0ABC6292195F\:ABPerson END:VCARD Expected result: ---------------- Contact_Vcard_Parse should handle ";"-seperated strings in a general sense, and also parse the apple-vcards correctly. Actual result: -------------- here is a print_r dump of the parsed vcard-export-file Array ( [VERSION] => Array ( [0] => Array ( [param] => Array ( ) [value] => Array ( [0] => Array ( [0] => 3.0 ) ) ) ) [N] => Array ( [0] => Array ( [param] => Array ( ) [value] => Array ( [0] => Array ( [0] => Shagnasty ) [1] => Array ( [0] => Bolivar ) [2] => Array ( [0] => Odysseus ) [3] => Array ( [0] => Mr. ) [4] => Array ( [0] => III,B.S. ) ) ) ) [FN] => Array ( [0] => Array ( [param] => Array ( ) [value] => Array ( [0] => Array ( [0] => Mr. Bolivar Odysseus Shagnasty III,B.S. ) ) ) ) [EMAIL] => Array ( [0] => Array ( [param] => Array ( [TYPE] => Array ( [0] => INTERNET [1] => HOME [2] => pref ) ) [value] => Array ( [0] => Array ( [0] => boshag@example.com ) ) ) [1] => Array ( [param] => Array ( [TYPE] => Array ( [0] => INTERNET [1] => WORK ) ) [value] => Array ( [0] => Array ( [0] => boshag@ciaweb.net ) ) ) ) [ITEM1.ADR] => Array ( [0] => Array ( [param] => Array ( [TYPE] => Array ( [0] => HOME [1] => pref ) ) [value] => Array ( [0] => Array ( [0] => ;;123 Main,Apartment 101;Beverly Hills;CA;90210; ) ) ) ) [ITEM1.X-ABADR] => Array ( [0] => Array ( [param] => Array ( ) [value] => Array ( [0] => Array ( [0] => at ) ) ) ) [ITEM2.ADR] => Array ( [0] => Array ( [param] => Array ( [TYPE] => Array ( [0] => WORK ) ) [value] => Array ( [0] => Array ( [0] => ;;test1;test2;;111122222;test3 ) ) ) ) [ITEM2.X-ABADR] => Array ( [0] => Array ( [param] => Array ( ) [value] => Array ( [0] => Array ( [0] => at ) ) ) ) [X-ABUID] => Array ( [0] => Array ( [param] => Array ( ) [value] => Array ( [0] => Array ( [0] => 7D26C3AC-5F1F-422A-A156-0ABC6292195F:ABPerson ) ) ) ) )

Comments

 [2006-05-18 02:30 UTC] rfujita at redhat dot com (Ryo Fujita)
This is just a workaround :) 461c461,465 < $value = array(array($right)); --- > if(preg_match("/ITEM[0-9]*\.ADR/", $typedef)){ > $value = $this->_parseADR($right); > } else { > $value = array(array($right)); > }
 [2006-12-12 17:54 UTC] cweiske (Christian Weiske)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.