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 #639

bug when vCard contains notes

Details

Submitted2004-01-28 23:34 UTC
Fromchorton at inlandpac dot com
StatusBogus
PackageContact_Vcard_Parse
PHP Version4.3.0
OSLinux
Roadmaps(Not assigned)

Comments

[2004-01-28 23:34 UTC] chorton at inlandpac dot com

Description:
------------
The NOTES parsing seems to be quite buggy. I am not sure if it is the line breaks, or just the way the engine looks for the vCard fields.

BEGIN:VCARD
VERSION:2.1
N:Horton;Chad
FN:Chad Horton
NICKNAME:PHP-Vyper
ORG:Insight Enterprises, Inc.;EBusiness
TITLE:Developer Lead, eCommerce
NOTE;ENCODING=QUOTED-PRINTABLE:Test1:=0D=0AThis is test 1=0D=0A=0D=0ATest2:=0D=0AThis is test 2=0D=0A=0D=
=0ATest3:=0D=0AThis is test 3=0D=0A=0D=0A <<Chad Horton's Birthday>> <<Chad=
Horton's Anniversary>> =0D=0A
TEL;WORK;VOICE:(480) 333-3000 x3157
TEL;WORK;FAX:(480) 760-9632
ADR;HOME:;;10027 S 51st St;Phoenix;AZ;85044-5219;United States of America
LABEL;HOME;ENCODING=QUOTED-PRINTABLE:10027 S 51st St=0D=0APhoenix, AZ 85044-5219=0D=0AUnited States of America
URL;WORK:http://www.insight.com
BDAY:19721214
EMAIL;PREF;INTERNET:chorton@Insight.com
REV:20040128T232432Z
END:VCARD

Reproduce code:
---------------
<?php

// include the class file
require_once 'Contact_Vcard_Parse.php';

// instantiate a parser object
$parse = new Contact_Vcard_Parse();

// parse a vCard file and store the data
// in $cardinfo
$cardinfo = $parse->fromFile('Chad Horton.vcf');

// view the card info array
echo '<pre>';
print_r($cardinfo);
echo '</pre>';

?>

Expected result:
----------------
[NOTE] => Array
(
[0] => Array
(
[param] => Array
(
[ENCODING] => Array
(
[0] => QUOTED-PRINTABLE
)
)
[value] => Array
(
[0] => Array
(
[0] => Test1:
This is test 1

Test2:
This is test 2

Test3:
This is test 3
)
)
)
)

Actual result:
--------------
[NOTE] => Array
(
[0] => Array
(
[param] => Array
(
[ENCODING] => Array
(
[0] => QUOTED-PRINTABLE
)
)
[value] => Array
(
[0] => Array
(
[0] => Test1:
This is test 1

Test2:
This is test 2
)
)
)
)
[=0ATest3] => Array
(
[0] => Array
(
[param] => Array
(
)
[value] => Array
(
[0] => Array
(
[0] => =0D=0AThis is test 3=0D=0A=0D=0A <> <> =0D=0A
)
)
)
)