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

Bug #18128 error notice while importing vcards
Submitted: 2010-12-20 20:30 UTC
From: matthieu Assigned: till
Status: Closed Package: File_IMC
PHP Version: 5.3.3 OS: linux
Roadmaps: 0.4.2    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 50 - 25 = ?

 
 [2010-12-20 20:30 UTC] matthieu (Matthieu Robillard)
Description: ------------ Some vcards (the ones with pictures apparently) throw this notice while importing : Notice: Undefined offset: 1 in /var/www/.../IMC/Parse.php on line 563 This patch seems to fix the issue : --- Parse.php +++ (clipboard) @@ -560,7 +560,7 @@ $name = $this->_getParamName($key); // list of all parameter values - $listall = trim($tmp[1]); + $listall = array_key_exists(1, $tmp) ? trim($tmp[1]) : ""; // if there is a value-list for this parameter, they are // separated by commas, so split them out too.

Comments

 [2010-12-20 20:43 UTC] till (Till Klampaeckel)
Hi Matthieu, can you supply an example vcard and some code too so I can write a test? Bonus points if you write the test (.phpt). Till
 [2010-12-20 20:43 UTC] till (Till Klampaeckel)
-Status: Open +Status: Analyzed -Assigned To: +Assigned To: till
 [2010-12-20 22:43 UTC] matthieu (Matthieu Robillard)
Hi Till, the notice appears with this vcard (created with OSX AddressBook) : BEGIN:VCARD VERSION:3.0 N:test;test;;; FN:test test ORG:test; EMAIL;type=INTERNET;type=WORK;type=pref:aaa@exemple.com TEL;type=WORK;type=pref:12345678 TEL;type=CELL:12345678 PHOTO;BASE64: /9j/4AAQSkZJRgABAQAAAQABAAD/4QBARXhpZgAATU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAA AqACAAQAAAABAAAApKADAAQAAAABAAAApAAAAAD/2wBDAAIBAQIBAQICAQICAgICAwUDAwMDAwYE ... ... ... AIKa/sy/DvxtuuvCAi1zxjPp+f3d5f2VuiWxmB4dIzO7hMffCntiiigD7Es5TPaRPJ950DH6kVJR RQA1ow3J60UUUAf/2Q== item1.X-ABRELATEDNAMES;type=pref:aaa item1.X-ABLabel:_$!<Friend>!$_ X-ABUID:4869E630-8027-4F9E-914A-ED3AF7F7C004\:ABPerson END:VCARD There is no "type=" for PHOTO Parse.php (563) : $tmp = Array ( [0] => BASE64 ) and $tmp[1] is null
 [2011-03-11 22:17 UTC] till (Till Klampaeckel)
-Status: Analyzed +Status: Closed -Roadmap Versions: +Roadmap Versions: 0.4.2
This bug has been fixed in SVN. 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.