CRM-18484 : Error thrown in Reports if one of the params for in between filter is...
authoryashodha <yashodha.chaku@webaccessglobal.com>
Fri, 29 Apr 2016 08:55:41 +0000 (14:25 +0530)
committeryashodha <yashodha.chaku@webaccessglobal.com>
Fri, 29 Apr 2016 08:55:41 +0000 (14:25 +0530)
----------------------------------------
* CRM-18484: Error thrown in Reports if one of the params for in between filter is NULL
  https://issues.civicrm.org/jira/browse/CRM-18484

CRM/Report/Form.php

index aa8fd77fdc81586ed80b01c48b1facc4f726c509..4f34d60dfe52ba3b622fc813fce59bd9a0a27138 100644 (file)
@@ -1775,10 +1775,9 @@ class CRM_Report_Form extends CRM_Core_Form {
         if (($min !== NULL && strlen($min) > 0) ||
           ($max !== NULL && strlen($max) > 0)
         ) {
-          $min = CRM_Utils_Type::escape($min, $type);
-          $max = CRM_Utils_Type::escape($max, $type);
           $clauses = array();
           if ($min) {
+            $min = CRM_Utils_Type::escape($min, $type);
             if ($op == 'bw') {
               $clauses[] = "( {$field['dbAlias']} >= $min )";
             }
@@ -1787,6 +1786,7 @@ class CRM_Report_Form extends CRM_Core_Form {
             }
           }
           if ($max) {
+            $max = CRM_Utils_Type::escape($max, $type);
             if ($op == 'bw') {
               $clauses[] = "( {$field['dbAlias']} <= $max )";
             }