/**
* abook_local_file.php
*
- * @copyright © 1999-2005 The SquirrelMail Project Team
+ * @copyright © 1999-2006 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package squirrelmail
while ($row = @fgetcsv($this->filehandle, 2048, '|')) {
$line = join(' ', $row);
- if(eregi($expr, $line)) {
+ /**
+ * TODO: regexp search is supported only in local_file backend.
+ * Do we check format of regexp or ignore errors?
+ */
+ // errors on eregi call are suppressed in order to prevent display of regexp compilation errors
+ if(@eregi($expr, $line)) {
array_push($res, array('nickname' => $row[0],
'name' => $row[1] . ' ' . $row[2],
'firstname' => $row[1],
/* Here is the data to write */
$data = $this->quotevalue($userdata['nickname']) . '|' .
$this->quotevalue($userdata['firstname']) . '|' .
- $this->quotevalue($userdata['lastname']) . '|' .
+ $this->quotevalue((!empty($userdata['lastname'])?$userdata['lastname']:'')) . '|' .
$this->quotevalue($userdata['email']) . '|' .
- $this->quotevalue($userdata['label']);
+ $this->quotevalue((!empty($userdata['label'])?$userdata['label']:''));
/* Strip linefeeds */
$data = ereg_replace("[\r\n]", ' ', $data);
} else {
$rows[$i++] = array(0 => $userdata['nickname'],
1 => $userdata['firstname'],
- 2 => $userdata['lastname'],
+ 2 => (!empty($userdata['lastname'])?$userdata['lastname']:''),
3 => $userdata['email'],
- 4 => $userdata['label']);
+ 4 => (!empty($userdata['label'])?$userdata['label']:''));
}
}
}
} /* End of class abook_local_file */
-?>
\ No newline at end of file
+?>