From 751e4207fc7d64a15d40d9a52642f5ff7efbbc5d Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 10 Oct 2005 23:47:56 +0000 Subject: [PATCH] r542: Pseudo-hackish way to make sure we don't keep re-grabbing bugs if we don't have permission --- search.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/search.php b/search.php index a3f647d..4fcaebe 100644 --- a/search.php +++ b/search.php @@ -242,13 +242,15 @@ if ($_REQUEST['do'] == 'process') LEFT JOIN " . TABLE_PREFIX . "bugvaluefill AS bugfieldvalue ON (bug.bugid = bugfieldvalue.bugid) WHERE bug.bugid <> 0 - AND bug.productid IN (" . fetch_on_bits('canviewbugs') . ") - AND (!bug.hidden OR (bug.hidden AND bug.productid IN (" . fetch_on_bits('canviewhidden') . "))) + AND bug.productid IN (#<'ONBITS:VIEW'>#) + AND (!bug.hidden OR (bug.hidden AND bug.productid IN (#<'ONBITS:HIDDEN'>#))) " . implode("\n\t\t", $querybuild) . " GROUP BY bug.bugid $sortclause"; - $search = $db->query($query); + $runquery = str_replace(array("#<'ONBITS:VIEW'>#", "#<'ONBITS:HIDDEN'>#"), array(fetch_on_bits('canviewbugs'), fetch_on_bits('canviewhidden')), $query); + + $search = $db->query($runquery); $numrows = $db->num_rows($search); @@ -357,7 +359,7 @@ if ($_REQUEST['do'] == 'results') $search = $cachedsearch; if ($search['dateline'] < TIMENOW - 900 OR $bugsys->in['rerun']) { - $search = $db->query($search['query']); + $search = $db->query(str_replace(array("#<'ONBITS:VIEW'>#", "#<'ONBITS:HIDDEN'>#"), array(fetch_on_bits('canviewbugs'), fetch_on_bits('canviewhidden')), $search['query'])); while ($bug = $db->fetch_array($search)) { $ids[] = $bug['bugid']; -- 2.43.5