* Properly retains the mailbox when you use the HTML addressbook
[squirrelmail.git] / functions / abook_local_file.php
index 7699c74eb861dd6569d8f388a26efff9631bd8dc..26588d117801eeea8cae662b9c7f49d72f26384b 100644 (file)
 
      // 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"));
 
        // Make regexp from glob'ed expression
        // May want to quote other special characters like (, ), -, [, ], etc.
-       $expr = ereg_replace('\\?', '.', $expr);
-       $expr = ereg_replace('\\*', '.*', $expr);
+       $expr = str_replace('?', '.', $expr);
+       $expr = str_replace('*', '.*', $expr);
 
        $res = array();
        if(!$this->open())
        }
 
        // Write data back
-       if(!$this->overwrite(&$rows)) {
+       if(!$this->overwrite($rows)) {
         $this->unlock();
         return false;
        }
        }
 
        // Write data back
-       if(!$this->overwrite(&$rows)) {
+       if(!$this->overwrite($rows)) {
         $this->unlock();
         return false;
        }