if (!is_array($value)) {
$value = CRM_Utils_Type::escape($strtolower($value), 'String');
}
+ // in api sometimes params is in array('sqlOp' => (mixed)'values') format
+ elseif (!empty($value) && in_array(key($value), CRM_Core_DAO::acceptedSQLOperators(), TRUE)) {
+ $op = key($value);
+ $value = CRM_Utils_Type::escape($strtolower($value[$op]), 'String');
+ }
+
+ if (strstr($op, 'NULL') || strstr($op, 'EMPTY')) {
+ $value = NULL;
+ }
elseif ($isSerialized && strstr($op, 'IN')) {
$value = implode(',', $value);
}