Remove accidentally committed rubbish. Add debugging.

This commit is contained in:
Andrew McMillan 2007-08-24 12:58:55 +12:00
parent 9b20688dc8
commit f0abf110bf

View File

@ -62,6 +62,10 @@ $need_post_filter = false;
function SqlFilterFragment( $filter, $components, $property = null, $parameter = null ) { function SqlFilterFragment( $filter, $components, $property = null, $parameter = null ) {
global $need_post_filter; global $need_post_filter;
$sql = ""; $sql = "";
if ( !is_array($filter) ) {
dbg_error_log( "REPORT", "Filter is of type '%s', but should be an array of XML Tags.", gettype($filter) );
}
foreach( $filter AS $k => $v ) { foreach( $filter AS $k => $v ) {
$tag = $v->GetTag(); $tag = $v->GetTag();
dbg_error_log("REPORT", "Processing $tag into SQL - %d, '%s', %d\n", count($components), $property, isset($parameter) ); dbg_error_log("REPORT", "Processing $tag into SQL - %d, '%s', %d\n", count($components), $property, isset($parameter) );
@ -120,14 +124,13 @@ function SqlFilterFragment( $filter, $components, $property = null, $parameter =
$collation = $v->GetAttribute("COLLATION"); $collation = $v->GetAttribute("COLLATION");
switch( strtolower($collation) ) { switch( strtolower($collation) ) {
case 'i;octet': case 'i;octet':
$comparison = 'ILIKE'; $comparison = 'LIKE';
break; break;
case 'i;ascii-casemap': case 'i;ascii-casemap':
default: default:
$comparison = 'ILIKE'; $comparison = 'ILIKE';
break; break;
} }
if $match = !$match;
$sql .= sprintf( "AND %s%s %s %s ", (isset($negate) && strtolower($negate) == "yes" ? "NOT ": ""), $sql .= sprintf( "AND %s%s %s %s ", (isset($negate) && strtolower($negate) == "yes" ? "NOT ": ""),
$property, $comparison, qpg("%".$search."%") ); $property, $comparison, qpg("%".$search."%") );
break; break;