From 507832e7aaf3b34e2165c871632c5eb365125240 Mon Sep 17 00:00:00 2001 From: fidian Date: Wed, 7 Feb 2001 16:39:03 +0000 Subject: [PATCH] * Minor bugfixes with addressbooks * Local addresses now list again when you hit the Addresses button on the compose.php form. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1071 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/abook_local_file.php | 6 +++--- functions/addressbook.php | 2 +- src/addrbook_search_html.php | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/functions/abook_local_file.php b/functions/abook_local_file.php index ab2be30e..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")); @@ -286,7 +286,7 @@ } // Write data back - if(!$this->overwrite(&$rows)) { + if(!$this->overwrite($rows)) { $this->unlock(); return false; } @@ -330,7 +330,7 @@ } // Write data back - if(!$this->overwrite(&$rows)) { + if(!$this->overwrite($rows)) { $this->unlock(); return false; } diff --git a/functions/addressbook.php b/functions/addressbook.php index fa53c7e3..8385ca3c 100644 --- a/functions/addressbook.php +++ b/functions/addressbook.php @@ -112,7 +112,7 @@ $ret = array(); for($i = 1 ; $i <= $this->numbackends ; $i++) { if(empty($type) || $type == $this->backends[$i]->btype) { - array_push($ret, &$this->backends[$i]); + $ret[] = &$this->backends[$i]; } } return $ret; diff --git a/src/addrbook_search_html.php b/src/addrbook_search_html.php index 3e1c696f..94590191 100644 --- a/src/addrbook_search_html.php +++ b/src/addrbook_search_html.php @@ -109,7 +109,7 @@ // --- End functions --- displayPageHeader($color, 'None'); - + // Initialize addressbook $abook = addressbook_init(); @@ -131,7 +131,7 @@ printf(" %s\n", _("Search for")); addr_insert_hidden(); if (! isset($addrquery)) - $addrquery = ""; + $addrquery = ''; printf(" \n", htmlspecialchars($addrquery)); @@ -166,10 +166,10 @@ // End search form // Show personal addressbook - if(!isset($addrquery) || !empty($listall)) { + if($addrquery == '' || !empty($listall)) { - if(! isset($backend) || $backend != -1 || !isset($addrquery)) { - if(!isset($addrquery)) + if(! isset($backend) || $backend != -1 || $addrquery == '') { + if($addrquery == '') $backend = $abook->localbackend; //printf("

%s

\n", $abook->backends[$backend]->sname); @@ -212,7 +212,7 @@ } } - if (!$addrquery || sizeof($res) == 0) { + if ($addrquery == '' || sizeof($res) == 0) { printf('
'."\n", $PHP_SELF); addr_insert_hidden(); printf("\n", _("Return")); -- 2.25.1