Skip to content

Commit 8d6753a

Browse files
committed
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
1 parent 09e9d4b commit 8d6753a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mailer.http.class.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ function sparkpostSend()
3737
$this->edebug(sprintf('Making HTTP POST request to %s', $this->endpoint));
3838
$result = $http->request($this->endpoint, $data);
3939
$this->edebug('Response received');
40-
$this->edebug('Response headers: ' . print_r($result['headers'], true));
41-
$this->edebug('Response body: ' . print_r($result['body'], true));
4240

4341
return $this->handle_response($result);
4442

@@ -148,6 +146,9 @@ protected function handle_response($response)
148146
$this->edebug($response->get_error_messages());
149147
return false;
150148
}
149+
150+
$this->edebug('Response headers: ' . print_r($result['headers'], true));
151+
$this->edebug('Response body: ' . print_r($result['body'], true));
151152

152153
$body = json_decode($response['body']);
153154
if (property_exists($body, 'errors')) {

0 commit comments

Comments
 (0)