From: Chris Burgess Date: Thu, 9 Jul 2015 04:02:23 +0000 (+1200) Subject: CRM-16821. Escape output from Authorize IPN. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=267353f4eeb33b4dd55e9f4f80410851c1109198;hp=faffa2c753facf2facdb129faf9f55ce201f7cf5;p=civicrm-core.git CRM-16821. Escape output from Authorize IPN. --- diff --git a/CRM/Core/Payment/AuthorizeNetIPN.php b/CRM/Core/Payment/AuthorizeNetIPN.php index 85e3a60b82..97f35ba2ec 100644 --- a/CRM/Core/Payment/AuthorizeNetIPN.php +++ b/CRM/Core/Payment/AuthorizeNetIPN.php @@ -183,7 +183,8 @@ class CRM_Core_Payment_AuthorizeNetIPN extends CRM_Core_Payment_BaseIPN { $recur->cancel_date = $now; $recur->save(); - CRM_Core_Error::debug_log_message("Subscription payment failed - '{$input['response_reason_text']}'"); + $message = ts("Subscription payment failed - %1", array(1 => htmlspecialchars($input['response_reason_text']))); + CRM_Core_Error::debug_log_message($message); // the recurring contribution has declined a payment or has failed // so we just fix the recurring contribution and not change any of @@ -195,7 +196,7 @@ class CRM_Core_Payment_AuthorizeNetIPN extends CRM_Core_Payment_BaseIPN { // check if contribution is already completed, if so we ignore this ipn if ($objects['contribution']->contribution_status_id == 1) { $transaction->commit(); - CRM_Core_Error::debug_log_message("returning since contribution has already been handled"); + CRM_Core_Error::debug_log_message("Returning since contribution has already been handled."); echo "Success: Contribution has already been handled

"; return TRUE; } @@ -266,14 +267,14 @@ INNER JOIN civicrm_contribution co ON co.contribution_recur_id = cr.id $contRecur->fetch(); $ids['contributionRecur'] = $contRecur->id; if ($ids['contact'] != $contRecur->contact_id) { - CRM_Core_Error::debug_log_message("Recurring contribution appears to have been re-assigned from id {$ids['contact']} to {$contRecur->contact_id} - Continuing with {$contRecur->contact_id} - "); + $message = ts("Recurring contribution appears to have been re-assigned from id %1 to %2, continuing with %2.", array(1 => $ids['contact'], 2 => $contRecur->contact_id)); + CRM_Core_Error::debug_log_message($message); $ids['contact'] = $contRecur->contact_id; } if (!$ids['contributionRecur']) { - CRM_Core_Error::debug_log_message("Could not find contributionRecur id: " . print_r($input, TRUE)); - echo "Failure: Could not find contributionRecur

"; + $message = ts("Could not find contributionRecur id: %1", array(1 => htmlspecialchars(print_r($input, TRUE)))); + CRM_Core_Error::debug_log_message($message); + echo "Failure: $message

"; exit(); }