From aa45f943c4996fac43c7b4043bd5cfcc508334b7 Mon Sep 17 00:00:00 2001 From: jmunro Date: Thu, 4 Apr 2002 14:43:19 +0000 Subject: [PATCH] fixed warnings when not using search history git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2678 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/search.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/search.php b/src/search.php index 74faba44..27fe5ca7 100644 --- a/src/search.php +++ b/src/search.php @@ -165,6 +165,7 @@ $attributes = array (); $saved_attributes = array (); $search_all = 'none'; $perbox_count = array (); +$recent_count = getPref($data_dir, $username, 'search_memory', 0); /* get mailbox names */ $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); @@ -188,7 +189,9 @@ if ((!isset($submit) || empty($submit)) && !empty($what)) { if ( !isset( $submit ) ) { $submit = ''; } else if ($submit == _("Search") && !empty($what)) { - update_recent($what, $where, $mailbox, $username, $data_dir); + if ($recent_count > 0) { + update_recent($what, $where, $mailbox, $username, $data_dir); + } } elseif ($submit == 'forget') { forget_recent($count, $username, $data_dir); @@ -211,7 +214,6 @@ echo "
\n". /* update the recent and saved searches from the pref files */ $attributes = get_recent($username, $data_dir); -$recent_count = getPref($data_dir, $username, 'search_memory', 0); $saved_attributes = get_saved($username, $data_dir); $saved_count = count($saved_attributes['saved_what']); $count_all = 0; -- 2.25.1