diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/functions_search.inc.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/functions_search.inc.php b/include/functions_search.inc.php index 66be23bb4..8e474019a 100644 --- a/include/functions_search.inc.php +++ b/include/functions_search.inc.php @@ -117,9 +117,13 @@ function get_sql_search_clause($search) create_function('&$s','$s="(".$s.")";') ); - array_push( - $clauses, - "\n ". + // make sure the "mode" is either OR or AND + if ($search['fields']['allwords']['mode'] != 'AND' and $search['fields']['allwords']['mode'] != 'OR') + { + $search['fields']['allwords']['mode'] = 'AND'; + } + + $clauses[] = "\n ". implode( "\n ". $search['fields']['allwords']['mode']. @@ -797,4 +801,4 @@ function get_search_results($search_id, $super_order_by, $images_where='') return get_quick_search_results($search['q'], $super_order_by, $images_where); } } -?>
\ No newline at end of file +?> |