From 8d6753aabd6b7166d0f7178cc810c1d7b9cf65f0 Mon Sep 17 00:00:00 2001 From: Fender123 Date: Thu, 7 Apr 2016 15:11:45 +0200 Subject: [PATCH] fixed php warning caused by call to edebug moved debug output from sparkpostSend to handle_response to make sure $result is an array and not WP_Error --- mailer.http.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mailer.http.class.php b/mailer.http.class.php index d7698656..47542970 100644 --- a/mailer.http.class.php +++ b/mailer.http.class.php @@ -37,8 +37,6 @@ function sparkpostSend() $this->edebug(sprintf('Making HTTP POST request to %s', $this->endpoint)); $result = $http->request($this->endpoint, $data); $this->edebug('Response received'); - $this->edebug('Response headers: ' . print_r($result['headers'], true)); - $this->edebug('Response body: ' . print_r($result['body'], true)); return $this->handle_response($result); @@ -148,6 +146,9 @@ protected function handle_response($response) $this->edebug($response->get_error_messages()); return false; } + + $this->edebug('Response headers: ' . print_r($result['headers'], true)); + $this->edebug('Response body: ' . print_r($result['body'], true)); $body = json_decode($response['body']); if (property_exists($body, 'errors')) {