Update of /cvsroot/stack/stack-1-0/scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10792/scripts
Modified Files:
stackDatabase.php
Log Message:
Index: stackDatabase.php
===================================================================
RCS file: /cvsroot/stack/stack-1-0/scripts/stackDatabase.php,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** stackDatabase.php 3 Jul 2005 15:56:32 -0000 1.25
--- stackDatabase.php 3 Jul 2005 16:24:23 -0000 1.26
***************
*** 440,453 ****
// SEARCH over the keywords
! if ('' != $filter_kw) {
$filter_needed = TRUE;
$filter = explode(',',$filter_kw);
! foreach ($filter as $key => $val) {
$val = trim($val);
if ('' != $val) {
if ('Any' == $filter_any) {
! $dispQ = max(strpos($kw,$val),$dispQ);
} else {
! $dispQ = min(strpos($kw,$val),$dispQ);
}
}
--- 440,459 ----
// SEARCH over the keywords
! if ('' != trim($filter_kw)) {
$filter_needed = TRUE;
$filter = explode(',',$filter_kw);
! foreach ($filter as $val) {
$val = trim($val);
if ('' != $val) {
+ // We have to be careful with strpos. It can return values that look like FALSE, such as zero,
+ $matched = TRUE;
+ if (FALSE === strpos($kw,$val)) {
+ $matched = FALSE;
+ }
+
if ('Any' == $filter_any) {
! $dispQ = max($matched,$dispQ);
} else {
! $dispQ = min($matched,$dispQ);
}
}
***************
*** 455,468 ****
}
! if ('' != $filter_name) {
$filter_needed = TRUE;
$filter = explode(',',$filter_name);
! foreach ($filter as $key => $val) {
$val = trim($val);
if ('' != $val) {
if ('Any' == $filter_any) {
! $dispQ = max(strpos($name,$val),$dispQ);
} else {
! $dispQ = min(strpos($name,$val),$dispQ);
}
}
--- 461,480 ----
}
! if ('' != trim($filter_name)) {
$filter_needed = TRUE;
$filter = explode(',',$filter_name);
! foreach ($filter as $val) {
$val = trim($val);
if ('' != $val) {
+ // We have to be careful with strpos. It can return values that look like FALSE, such as zero,
+ $matched = TRUE;
+ if (FALSE === strpos($name,$val)) {
+ $matched = FALSE;
+ }
+
if ('Any' == $filter_any) {
! $dispQ = max($matched,$dispQ);
} else {
! $dispQ = min($matched,$dispQ);
}
}
***************
*** 475,479 ****
}
! return($dispQ);
}
--- 487,491 ----
}
! return ($dispQ);
}
|