|
From: Benjamin C. <bc...@us...> - 2003-07-13 14:20:21
|
Update of /cvsroot/phpbt/phpbt
In directory sc8-pr-cvs1:/tmp/cvs-serv1373
Modified Files:
Tag: phpbt-1_0
query.php
Log Message:
Fixes bug #723019 (again) - Use and instead of or for joining query chunks
Index: query.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/query.php,v
retrieving revision 1.96
retrieving revision 1.96.2.1
diff -u -r1.96 -r1.96.2.1
--- query.php 21 Jun 2003 13:36:30 -0000 1.96
+++ query.php 13 Jul 2003 14:20:18 -0000 1.96.2.1
@@ -120,7 +120,7 @@
case '=' : $econd = "$emailtype1 '$email1'"; break;
}
foreach($emailfield1 as $field) $equery[] = "$field.$emailsearch1 $econd";
- $query[] = '('.@join(' or ',$equery).')';
+ $query[] = '('.@join(' and ',$equery).')';
}
// Text search field(s)
@@ -134,7 +134,7 @@
$fields[] = "$searchfield $cond";
}
}
- if (!empty($fields)) $query[] = '('.@join(' or ',$fields).')';
+ if (!empty($fields)) $query[] = '('.@join(' and ',$fields).')';
// Project/Version/Component
if (!empty($projects)) {
@@ -147,6 +147,12 @@
} elseif (!$perm->have_perm('Admin')) { // Filter results from hidden projects
$query[] = "b.project_id not in ($restricted_projects)";
}
+ // TODO: Something like this can be used for searching descriptions
+ /*
+ select b.bug_id, b.title, b.description, c.comment_id, c.comment_text
+ from bug b left join comment c using (bug_id)
+ where description like '%yet%' or comment_text like '%yet%'
+ */
}
if (!empty($query)) {
|