cvs: pear /File_IMC/File/IMC/Parse vCard.php
| From: | Paul Jones | Date: | Sat, 28 May 2005 15:47:41 +0000 |
| Subject: | cvs: pear /File_IMC/File/IMC/Parse vCard.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-32184@lists.php.net to get a copy of this message | ||
pmjones Sat May 28 11:47:41 2005 EDT
Modified files:
/pear/File_IMC/File/IMC/Parse vCard.php
Log:
applied padding to element arrays for N, ADR, and GEO to make sure the right number of elements
are available for processing
http://cvs.php.net/diff.php/pear/File_IMC/File/IMC/Parse/vCard.php?r1=1.2&r2=1.3&ty=u
Index: pear/File_IMC/File/IMC/Parse/vCard.php
diff -u pear/File_IMC/File/IMC/Parse/vCard.php:1.2 pear/File_IMC/File/IMC/Parse/vCard.php:1.3
--- pear/File_IMC/File/IMC/Parse/vCard.php:1.2 Wed Nov 12 20:51:17 2003
+++ pear/File_IMC/File/IMC/Parse/vCard.php Sat May 28 11:47:41 2005
@@ -16,7 +16,7 @@
// | Authors: Paul M. Jones <pmjones@ciaweb.net> |
// +----------------------------------------------------------------------+
//
-// $Id: vCard.php,v 1.2 2003/11/13 01:51:17 pmjones Exp $
+// $Id: vCard.php,v 1.3 2005/05/28 15:47:41 pmjones Exp $
/**
@@ -83,7 +83,8 @@
function _parseN($text)
{
- $tmp = $this->splitBySemi($text);
+ // array_pad makes sure there are the right number of elements
+ $tmp = array_pad($this->splitBySemi($text), 5, '');
return array(
$this->splitByComma($tmp[FILE_IMC_VCARD_N_FAMILY]),
$this->splitByComma($tmp[FILE_IMC_VCARD_N_GIVEN]),
@@ -113,7 +114,8 @@
function _parseADR($text)
{
- $tmp = $this->splitBySemi($text);
+ // array_pad makes sure there are the right number of elements
+ $tmp = array_pad($this->splitBySemi($text), 7, '');
return array(
$this->splitByComma($tmp[FILE_IMC_VCARD_ADR_POB]),
$this->splitByComma($tmp[FILE_IMC_VCARD_ADR_EXTEND]),
@@ -210,7 +212,8 @@
function _parseGEO($text)
{
- $tmp = $this->splitBySemi($text);
+ // array_pad makes sure there are the right number of elements
+ $tmp = array_pad($this->splitBySemi($text), 2, '');
return array(
array($tmp[FILE_IMC_VCARD_GEO_LAT]), // lat
array($tmp[FILE_IMC_VCARD_GEO_LON]) // lon