#132 Export to vcf causes warnings

open
nobody
5
2009-01-22
2009-01-22
No

uninitialized variable is not checked properly.

Just need some "isset()" checks:

addressbook/lib/backEnd>svn diff
Index: ContactImportExport.class.php
===================================================================
--- ContactImportExport.class.php (revision 7712)
+++ ContactImportExport.class.php (working copy)
@@ -49,9 +49,9 @@
$type = $defaultType; // reset

$output .= 'ADR;TYPE=DOM,'.$type.',POSTAL:;' . $adr['line2'] . ';' . $adr['line1'] . ';' . $adr['city'] . ';' . $adr['state'] . ';' . $adr['zip'] . ';' . $country[$adr['country']] . "\n"; // \TODO modifier ,PREF before : for primary
- if($adr['phone1'])
+ if(isset($adr['phone1']))
$output .= 'TEL;TYPE='.$type.',VOICE:' . $adr['phone1'] . "\n";
- if($adr['phone2'])
+ if(isset($adr['phone2']))
$output .= 'TEL;TYPE='.$type.',VOICE:' . $adr['phone2'] . "\n";
}

Discussion

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks