From: Coleman Watts Date: Fri, 20 Nov 2015 00:40:57 +0000 (-0500) Subject: Merge branch 'aydun-CRM-16203' into 4.6 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=05839ccc1c721467fb2397b45572f160a542e4d3;p=civicrm-core.git Merge branch 'aydun-CRM-16203' into 4.6 Conflicts: CRM/Report/Form.php --- 05839ccc1c721467fb2397b45572f160a542e4d3 diff --cc CRM/Report/Form.php index 4980983f84,a77494857e..023302d722 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@@ -1737,17 -1737,24 +1737,13 @@@ class CRM_Report_Form extends CRM_Core_ break; case 'mhas': - // 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:]]'"; - } - break; - case 'mnot': - // mhas == multiple has - // mnot == multiple is not one of ++ // multiple has or multiple not if ($value !== NULL && count($value) > 0) { -- $sqlOP = $this->getSQLOperator($op); - $operator = ''; - if ($op == 'mnot') { - // mnot == multiple is not one of - $operator = 'NOT'; - } + $value = CRM_Utils_Type::escapeAll($value, $type); - $clause - = "( {$field['dbAlias']} NOT REGEXP '[[:cntrl:]]" . implode('|', $value) . - "[[:cntrl:]]' OR {$field['dbAlias']} IS NULL )"; ++ $operator = $op == 'mnot' ? 'NOT' : ''; + $regexp = "[[:cntrl:]]*" . implode('[[:>:]]*|[[:<:]]*', (array) $value) . "[[:cntrl:]]*"; + $clause = "{$field['dbAlias']} {$operator} REGEXP '{$regexp}'"; } break;