CRM-3887 Aggregate Contribution Custom Search throws MySQL errors if you use commas in the minimum or maximum

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.2.0
    • Component/s: CiviCRM Search
    • Labels:
      None

      Description

      If you use a comma to help designate 1000's places in the Aggregate Contribution custom search, CiviCRM 2.1.0 and up (possibly in 2.0 as well) you get a MySQL error because CiviCRM doesn't first filter the field for acceptable characters. This search needs to filter out unacceptable characters (commas, dollar signs, dashes) before dumping them into a SQL statement.

        Attachments

          Activity

          [CRM-3887] Aggregate Contribution Custom Search throws MySQL errors if you use commas in the minimum or maximum
          Lance Dockins added a comment -

          This fixes the problem with a simple preg_replace that filters out commas and dollar signs in the input values for min and max.

          Donald A. Lobo added a comment -


          We might want to use our cleanMoney function to filter the money argument

          Sunil Pawar added a comment -

          Verified in r18827.

          Kurund Jalmi added a comment -

          Batch move to verification

            People

            • Assignee:
              Kurund Jalmi
              Reporter:
              Lance Dockins

              Dates

              • Created:
                Updated:
                Resolved: