aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2014-01-17 12:50:14 +0000
committerplegall <plg@piwigo.org>2014-01-17 12:50:14 +0000
commit7f39d5b695f90f5d622f9b070a5a4815c584e707 (patch)
tree2f71e73ffe6d37c818b10cc891b766865f14022b /include
parent787089742d1d8e29f4d0d46c4458f43902d8fec7 (diff)
bug 3020 and bug 3021 fixed: additionnal checks in search inputs
git-svn-id: http://piwigo.org/svn/trunk@26825 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/functions_search.inc.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/functions_search.inc.php b/include/functions_search.inc.php
index 66452459e..9cf50d602 100644
--- a/include/functions_search.inc.php
+++ b/include/functions_search.inc.php
@@ -113,6 +113,12 @@ function get_sql_search_clause($search)
create_function('&$s','$s="(".$s.")";')
);
+ // 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']. "\n ",