diff --git a/lib/common.lib.php b/lib/common.lib.php index 059f775ca..9ca46d4e4 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -712,7 +712,7 @@ function get_sql_search($search_ca_name, $search_field, $search_text, $search_op $tmp = explode(",", trim($search_field)); $field = explode("||", $tmp[0]); $not_comment = ""; - if (!empty($tmp[1])) + if (isset($tmp[1])) $not_comment = $tmp[1]; $str .= "("; @@ -768,8 +768,11 @@ function get_sql_search($search_ca_name, $search_field, $search_text, $search_op $op1 = " $search_operator "; } $str .= " ) "; - if ($not_comment) + if ($not_comment === '1') { $str .= " and wr_is_comment = '0' "; + } else if ($not_comment === '0') { + $str .= " and wr_is_comment = '1' "; + } return $str; }