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

eWay - improvement - allow it to cope if open_basedir is set without error

    Details

    • Type: Patch
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.1.2
    • Fix Version/s: 3.1.3
    • Component/s: CiviContribute
    • Labels:
      None

      Description

      On servers where open_basedir is configured eWay payment processor presents an error message.

      warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /var/www/d6c22-html/sites/all/modules/civicrm/CRM/Core/Payment/eWAY.php on line 229.

      This patch prevents the error message from happening.

      Index: CRM/Core/Payment/eWAY.php
      ===================================================================
      — CRM/Core/Payment/eWAY.php (revision 26250)
      +++ CRM/Core/Payment/eWAY.php (working copy)
      @@ -225,8 +225,15 @@
      curl_setopt($submit, CURLOPT_POST, true );
      curl_setopt($submit, CURLOPT_RETURNTRANSFER, true ); // return the result on success, FALSE on failure
      curl_setopt($submit, CURLOPT_POSTFIELDS, $requestxml );

      • curl_setopt($submit, CURLOPT_TIMEOUT, 36000 );
      • curl_setopt($submit, CURLOPT_FOLLOWLOCATION, 1 ); // ensures any Location headers are followed
        + curl_setopt($submit, CURLOPT_TIMEOUT, 36000 );
        + // if open_basedir or safe_mode are enabled in PHP settings CURLOPT_FOLLOWLOCATION won't work so don't apply it
        + // it's not really required
        + if (ini_get('open_basedir') == '' && ini_get('safe_mode' == 'Off')) { + curl_setopt($submit, CURLOPT_FOLLOWLOCATION, 1 ); // ensures any Location headers are followed + }

        +
        +
        +

      // Send the data out over the wire
      //--------------------------------

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              eileen Eileen McNaughton
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: