Tracker: Current Stable Branch (1.4)

5 Address book entry's fields exceeding 2048 bytes - ID: 1181561
Last Update: Comment added ( tokul )

A call to the function "fgetcsv()" with an address entry
containing an exceedingly long "email" or "label" (or any
other fields) results in breakups of a single addressbook
entry (and thus resulting in multiple entries being
loaded). A simple solution might to be customize the
byte size to whatever is comfortable for an individual
application (as in our case which is an email service
provider).

Source: Stable Release v1.4.4
/**
* abook_local_file.php
*
* @version $Id: abook_local_file.php,v 1.22.2.5
2004/12/27 15:03:42 kink Exp $
* @package squirrelmail
* @subpackage addressbook
*/

... SNIPPED...

function list_addr() {
$res = array();
$this->open();
@rewind($this->filehandle);

while ($row = @fgetcsv($this->filehandle, 2048, '|'))
{
array_push($res, array('nickname' => $row[0],
'name' => $row[1] . ' ' . $row[2],
'firstname' => $row[1],
'lastname' => $row[2],
'email' => $row[3],
'label' => $row[4],
'backend' => $this->bnum,
'source' => &$this->sname));
}
return $res;
}


Jeremy Kei ( jeremykei ) - 2005-04-12 15:37

5

Closed

Fixed

Tomas Kuliavas

None

None

Public


Comments ( 4 )

Date: 2006-10-07 12:01
Sender: tokul

Logged In: YES
user_id=225877

implemented in 1.4.9cvs too.


Date: 2006-06-27 10:11
Sender: tokul

Logged In: YES
user_id=225877

address book line length configuration option is added to
1.5.2cvs. src/abook_local_file.php v.1.45


Date: 2005-05-25 17:52
Sender: jeremykei

Logged In: YES
user_id=1257932

I'm proposing a quick hack fix of the line

# while ($row = @fgetcsv($this->filehandle, 2048, '|'))

to, for illustrative purposes:

# while ($row = @fgetcsv($this->filehandle, 20480, '|'))

to handle huge concatenated email entries with tens/hundreds
of concatenated email addresses.



Date: 2005-05-24 19:10
Sender: kinkProject AdminAccepting Donations

Logged In: YES
user_id=285765

I'm sorry but I don't really understand... what's the
solution you're proposing?


Attached File

No Files Currently Attached

Changes ( 6 )

Field Old Value Date By
status_id Open 2006-10-07 12:01 tokul
close_date - 2006-10-07 12:01 tokul
data_type 423679 2006-06-27 10:11 tokul
resolution_id None 2006-06-27 10:11 tokul
category_id Address Book 2006-06-27 10:11 tokul
assigned_to nobody 2005-09-10 14:00 tokul