PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » File Formats » Contact_Vcard_Parse » Bug #5988

Contact_Vcard_Parse does not work with apple adressbook exported vcard files

Details

Submitted2005-11-16 17:42 UTC
Fromp dot a dot r dot a dot s dot e dot w at gmx dot net
Assignedcweiske
StatusClosed
PackageContact_Vcard_Parse
PHP Version5.1.0
OSapple osx tiger 10.4.3
Roadmaps(Not assigned)

Comments

[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
)

)

)

)

)

[2006-05-18 02:30 UTC] rfujita at redhat dot com

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));
> }