X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fabook_local_file.php;h=26588d117801eeea8cae662b9c7f49d72f26384b;hb=eeb44e402b11bd6d31865c963bbca5efab9b6278;hp=8bc02405d6be3df8f7bf851e7501331864e74fbd;hpb=701c9c6ba2c8723341a19a7e952e0d3d4bfbad77;p=squirrelmail.git diff --git a/functions/abook_local_file.php b/functions/abook_local_file.php index 8bc02405..26588d11 100644 --- a/functions/abook_local_file.php +++ b/functions/abook_local_file.php @@ -125,7 +125,7 @@ // Overwrite the file with data from $rows // NOTE! Previous locks are broken by this function - function overwrite($rows) { + function overwrite(&$rows) { $newfh = @fopen($this->filename, 'w'); if(!$newfh) return $this->set_error("$file: " . _("Open failed")); @@ -149,9 +149,10 @@ // To be replaced by advanded search expression parsing if(is_array($expr)) return; - // Make regexp from glob'ed expression - $expr = ereg_replace('\?', '.', $expr); - $expr = ereg_replace('\*', '.*', $expr); + // Make regexp from glob'ed expression + // May want to quote other special characters like (, ), -, [, ], etc. + $expr = str_replace('?', '.', $expr); + $expr = str_replace('*', '.*', $expr); $res = array(); if(!$this->open()) @@ -285,7 +286,7 @@ } // Write data back - if(!$this->overwrite(&$rows)) { + if(!$this->overwrite($rows)) { $this->unlock(); return false; } @@ -329,7 +330,7 @@ } // Write data back - if(!$this->overwrite(&$rows)) { + if(!$this->overwrite($rows)) { $this->unlock(); return false; }