0

This chunk of code requiring a session on a POST request causes call backs from various 3rd party providers to fail. It has an exception for payment IPNs (civicrm/payment/ipn).

  // check and ensure that we have a valid session
  if (!empty($_POST)) {
    $urlStart = substr(stripslashes(CRM_Utils_Array::value('task', $_GET)), 0, 19);
    // the session should not be empty
    // however for standalone forms, it will not have any CiviCRM variables in the
    // session either, so dont check for it
    if (empty($_SESSION) && $urlStart != 'civicrm/payment/ipn') {
      $config = CRM_Core_Config::singleton();
      CRM_Utils_System::redirect($config->userFrameworkBaseURL);
    }
  }
  1. Is this code block necessary?
  2. If so, is there a way to add other paths as exception?

Here are a couple of extension I have noticed that fail.

2
  • Not an answer to the main question, but that mailgun extension is quite old. You might be interested in github.com/artfulrobot/mailgunny – Aidan Nov 9 '20 at 21:08
  • That's awesome! Thank you. I have been wondering how long the legacy webhooks in Mailgun would survive. – David Hayes Nov 9 '20 at 21:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.