From f4fd60824eaffdef96b7ddea93ce8b48d340b9ef Mon Sep 17 00:00:00 2001 From: monishdeb Date: Tue, 24 Nov 2015 13:03:03 +0530 Subject: [PATCH] CRM-16203 conflict fix in master ---------------------------------------- * CRM-16203: https://issues.civicrm.org/jira/browse/CRM-16203 --- CRM/Report/Form.php | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index 1bd2b024f6..d8adc66607 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -1792,33 +1792,13 @@ class CRM_Report_Form extends CRM_Core_Form { break; case 'mhas': - // mhas == multiple has - if ($value !== NULL && count($value) > 0) { - $sqlOP = $this->getSQLOperator($op); - foreach ($value as $key => $val) { - $val = str_replace('(', '[[.left-parenthesis.]]', $val); - $val = str_replace(')', '[[.right-parenthesis.]]', $val); - $value[$key] = $val; - } - $sp = CRM_Core_DAO::VALUE_SEPARATOR; - $clause - = "{$field['dbAlias']} REGEXP '$sp" . implode("$sp|$sp", $value) . "$sp'"; - } - break; - case 'mnot': // multiple has or multiple not if ($value !== NULL && count($value) > 0) { - $sqlOP = $this->getSQLOperator($op); - foreach ($value as $key => $val) { - $val = str_replace('(', '[[.left-parenthesis.]]', $val); - $val = str_replace(')', '[[.right-parenthesis.]]', $val); - $value[$key] = $val; - } - $sp = CRM_Core_DAO::VALUE_SEPARATOR; - $clause - = "( {$field['dbAlias']} NOT REGEXP '$sp" . implode("$sp|$sp", $value) . - "$sp' OR {$field['dbAlias']} IS NULL )"; + $value = CRM_Utils_Type::escapeAll($value, $type); + $operator = $op == 'mnot' ? 'NOT' : ''; + $regexp = "[[:cntrl:]]*" . implode('[[:>:]]*|[[:<:]]*', (array) $value) . "[[:cntrl:]]*"; + $clause = "{$field['dbAlias']} {$operator} REGEXP '{$regexp}'"; } break; -- 2.25.1