From 17e0598eadad4495b9e039145f16426906d68807 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 6 Mar 2017 16:02:46 -0500 Subject: [PATCH] Use strict type checking in in_array This php function has a bug where it incorrectly returns true if the first param is 0. --- Civi/API/Api3SelectQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Civi/API/Api3SelectQuery.php b/Civi/API/Api3SelectQuery.php index 77bdd1b4b7..1585b152b1 100644 --- a/Civi/API/Api3SelectQuery.php +++ b/Civi/API/Api3SelectQuery.php @@ -106,7 +106,7 @@ class Api3SelectQuery extends SelectQuery { continue; } $operator = is_array($value) ? \CRM_Utils_Array::first(array_keys($value)) : NULL; - if (!in_array($operator, \CRM_Core_DAO::acceptedSQLOperators())) { + if (!in_array($operator, \CRM_Core_DAO::acceptedSQLOperators(), TRUE)) { $value = array('=' => $value); } $filters[$key] = \CRM_Core_DAO::createSQLFilter("{$table_name}.{$column_name}", $value); -- 2.25.1