cvs: pear /Contact_Vcard_Parse Contact_Vcard_Parse.php

From: Date: Sat, 28 May 2005 15:40:17 +0000
Subject: cvs: pear /Contact_Vcard_Parse Contact_Vcard_Parse.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-32181@lists.php.net to get a copy of this message
pmjones Sat May 28 11:40:17 2005 EDT Modified files: /pear/Contact_Vcard_Parse Contact_Vcard_Parse.php Log: fixed bug 4445 "vCard Parser fails when N field doesn't contain all fields" also fixed corresponding unreported issued in ADR and GEO fields http://cvs.php.net/diff.php/pear/Contact_Vcard_Parse/Contact_Vcard_Parse.php?r1=1.3&r2=1.4&ty=u Index: pear/Contact_Vcard_Parse/Contact_Vcard_Parse.php diff -u pear/Contact_Vcard_Parse/Contact_Vcard_Parse.php:1.3 pear/Contact_Vcard_Parse/Contact_Vcard_Parse.php:1.4 --- pear/Contact_Vcard_Parse/Contact_Vcard_Parse.php:1.3 Sat May 28 11:24:14 2005 +++ pear/Contact_Vcard_Parse/Contact_Vcard_Parse.php Sat May 28 11:40:17 2005 @@ -13,10 +13,10 @@ // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ -// | Authors: Paul M. Jones <pmjones@ciaweb.net> | +// | Authors: Paul M. Jones <pmjones@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Contact_Vcard_Parse.php,v 1.3 2005/05/28 15:24:14 pmjones Exp $ +// $Id: Contact_Vcard_Parse.php,v 1.4 2005/05/28 15:40:17 pmjones Exp $ /** @@ -46,11 +46,11 @@ * </code> * * -* @author Paul M. Jones <pmjones@ciaweb.net> +* @author Paul M. Jones <pmjones@php.net> * * @package Contact_Vcard_Parse * -* @version 1.30 +* @version 1.31 * */ @@ -273,6 +273,7 @@ * Used to make string human-readable after being a vCard value. * * Converts... + * \: => : * \; => ; * \, => , * literal \n => newline @@ -699,7 +700,8 @@ function _parseN($text) { - $tmp = $this->splitBySemi($text); + // make sure there are always at least 5 elements + $tmp = array_pad($this->splitBySemi($text), 5, ''); return array( $this->splitByComma($tmp[0]), // family (last) $this->splitByComma($tmp[1]), // given (first) @@ -729,7 +731,8 @@ function _parseADR($text) { - $tmp = $this->splitBySemi($text); + // make sure there are always at least 7 elements + $tmp = array_pad($this->splitBySemi($text), 7, ''); return array( $this->splitByComma($tmp[0]), // pob $this->splitByComma($tmp[1]), // extend @@ -826,7 +829,8 @@ function _parseGEO($text) { - $tmp = $this->splitBySemi($text); + // make sure there are always at least 2 elements + $tmp = array_pad($this->splitBySemi($text), 2, ''); return array( array($tmp[0]), // lat array($tmp[1]) // lon

« previous php.pear.cvs (#32181) next »