Menu

#132 Export to vcf causes warnings

Next Release
closed-accepted
5
2021-12-24
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

  • Jonathan Daley

    Jonathan Daley - 2021-12-24
    • status: open --> closed-accepted
    • assigned_to: Jonathan Daley
    • Group: --> Next Release
     
  • Jonathan Daley

    Jonathan Daley - 2021-12-24

    fixed in rev 666

     
  • Jonathan Daley

    Jonathan Daley - 2021-12-24

    while checking this, I noted some missing static classes that are required for PHP7. Fixed in rev 703.

     

Log in to post a comment.