CRM-16821. Escape output from Authorize IPN.
authorChris Burgess <chris@giantrobot.co.nz>
Thu, 9 Jul 2015 04:02:23 +0000 (16:02 +1200)
committerChris Burgess <chris@giantrobot.co.nz>
Thu, 9 Jul 2015 04:02:23 +0000 (16:02 +1200)
CRM/Core/Payment/AuthorizeNetIPN.php

index 85e3a60b829bc9bfa4c70cb90e9029a13ae267ea..97f35ba2ec1d929b474ec3cafe357907aba10e03 100644 (file)
@@ -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<p>";
       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<p>";
+      $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<p>";
       exit();
     }