// mhas == multiple has
if ($value !== NULL && count($value) > 0) {
$sqlOP = $this->getSQLOperator($op);
+ $value = CRM_Utils_Type::escapeAll($value, $type);
$clause
= "{$field['dbAlias']} REGEXP '[[:cntrl:]]" . implode('|', $value) .
"[[:cntrl:]]'";
// mnot == multiple is not one of
if ($value !== NULL && count($value) > 0) {
$sqlOP = $this->getSQLOperator($op);
+ $value = CRM_Utils_Type::escapeAll($value, $type);
$clause
= "( {$field['dbAlias']} NOT REGEXP '[[:cntrl:]]" . implode('|', $value) .
"[[:cntrl:]]' OR {$field['dbAlias']} IS NULL )";
return (isset($string)) ? $string : "";
}
+ /**
+ * Helper function to call escape on arrays
+ *
+ * @see escape
+ */
+ public static function escapeAll($data, $type, $abort = TRUE) {
+ foreach ($data as $key => $value) {
+ $data[$key] = CRM_Utils_Type::escape($value, $type, $abort);
+ }
+ return $data;
+ }
+
/**
* Verify that a variable is of a given type, and apply a bit of processing.
*