Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-13139

REST API: json_decode() fails for empty input

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.4.0
    • Fix Version/s: 4.4.0
    • Component/s: CiviCRM API
    • Labels:
      None

      Description

      We recently updated CRM.api() to use JSON encoding for all requests. This exposes another issue - the json_decode step in REST.php (circa line 380) interprets {} as invalid JSON because it is "empty". This causes a bug when a user clicks "Refresh" on the "Manage Extensions" screen.

      Try changing "if (empty($params))" to "if ($params === NULL)" or try making a special exception when $_REQUEST['json'] == '{}'

        Attachments

          Activity

            People

            • Assignee:
              timotten Tim Otten
              Reporter:
              timotten Tim Otten
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: