|
|
@@ -81,14 +81,18 @@ class SlackWebhookHandler extends AbstractProcessingHandler
|
|
|
$postString = json_encode($postData);
|
|
|
|
|
|
$ch = curl_init();
|
|
|
- curl_setopt($ch, CURLOPT_URL, $this->webhookUrl);
|
|
|
- curl_setopt($ch, CURLOPT_POST, true);
|
|
|
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
|
+ $options = [
|
|
|
+ CURLOPT_URL => $this->webhookUrl,
|
|
|
+ CURLOPT_POST => true,
|
|
|
+ CURLOPT_RETURNTRANSFER => true,
|
|
|
+ CURLOPT_HTTPHEADER => ['Content-type: application/json'],
|
|
|
+ CURLOPT_POSTFIELDS => $postString
|
|
|
+ ];
|
|
|
if (defined('CURLOPT_SAFE_UPLOAD')) {
|
|
|
- curl_setopt($ch, CURLOPT_SAFE_UPLOAD, true);
|
|
|
+ $options[CURLOPT_SAFE_UPLOAD] = true;
|
|
|
}
|
|
|
- curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-type: application/json']);
|
|
|
- curl_setopt($ch, CURLOPT_POSTFIELDS, $postString);
|
|
|
+
|
|
|
+ curl_setopt_array($ch, $options);
|
|
|
|
|
|
Curl\Util::execute($ch);
|
|
|
}
|