* 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)) {
+ // errors on preg_match call are suppressed in order to prevent display of regexp compilation errors
+ if(@preg_match('/' . $expr . '/i', $line)) {
array_push($res, array('nickname' => $row[0],
'name' => $this->fullname($row[1], $row[2]),
'firstname' => $row[1],
$this->quotevalue((!empty($userdata['label'])?$userdata['label']:''));
/* Strip linefeeds */
- $data = ereg_replace("[\r\n]", ' ', $data);
+ $nl_str = array("\r","\n");
+ $data = str_replace($nl_str, ' ', $data);
/**
* Make sure that entry fits into allocated record space.
function quotevalue($value) {
/* Quote the field if it contains | or ". Double quotes need to
* be replaced with "" */
- if(ereg("[|\"]", $value)) {
+ if(stristr('"', $value) || stristr('|', $value)) {
$value = '"' . str_replace('"', '""', $value) . '"';
}
return $value;