X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=functions%2Fabook_local_file.php;h=0c235e36bc8adc9be414977cccd717621b21d748;hp=1c1901f7a2e8fe92439ada1241416e7516d744b6;hb=1794d99316ac199aa68361e08a38b27faa07d5c4;hpb=d4e46166df04792c6b939356ea5dfda8e47bba7b diff --git a/functions/abook_local_file.php b/functions/abook_local_file.php index 1c1901f7..0c235e36 100644 --- a/functions/abook_local_file.php +++ b/functions/abook_local_file.php @@ -300,8 +300,8 @@ class abook_local_file extends addressbook_backend { * 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], @@ -433,7 +433,8 @@ class abook_local_file extends addressbook_backend { $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. @@ -588,7 +589,7 @@ class abook_local_file extends addressbook_backend { 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;