From 206da91d64e2874de507146d8983441cb8ceee32 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 17 Mar 2007 16:08:45 +0000 Subject: [PATCH] r1470: Fix two bugs with searching that would: - Delete the current search if it were ever to be rerun - Not update the timestamp on cached searches which would cause them to be rerun every time --- search.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/search.php b/search.php index ef7d144..5f2ceb9 100644 --- a/search.php +++ b/search.php @@ -397,7 +397,7 @@ if ($_REQUEST['do'] == 'process') $results[] = $result; } - if ($bugsys->userinfo['userid'] AND $cachedsearch['name'] == null AND !$bugsys->in['rerun']) + if ($bugsys->userinfo['userid'] AND !$cachedsearch AND !$bugsys->in['rerun']) { $db->query("DELETE FROM " . TABLE_PREFIX . "search WHERE userid = " . $bugsys->userinfo['userid'] . " AND name IS NULL"); } @@ -411,7 +411,7 @@ if ($_REQUEST['do'] == 'process') if ($cachedsearch) { - $db->query("UPDATE " . TABLE_PREFIX . "search SET ids = '" . implode(',', $ids) . "', resultcount = " . sizeof($results) . " WHERE searchid = " . $cachedsearch['searchid']); + $db->query("UPDATE " . TABLE_PREFIX . "search SET ids = '" . implode(',', $ids) . "', resultcount = " . sizeof($results) . ", dateline = " . TIMENOW . " WHERE searchid = " . $cachedsearch['searchid']); $search = $cachedsearch; } else -- 2.43.5