Skip to content

Commit f533674

Browse files
committed
Tightening error checking
1 parent 0553b8a commit f533674

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

src/Webhook.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public static function receive($input = null)
4242
}
4343
}
4444

45-
if ($input) {
45+
if (!is_null($input) && $input != '') {
4646
return self::processWebhook($input);
4747
}
4848

@@ -55,16 +55,14 @@ public static function receive($input = null)
5555
* @return array|false An associative array containing the details of the received webhook
5656
*/
5757
private static function processWebhook($input)
58-
{
59-
if ($input) {
60-
self::$receivedWebhook = $input;
61-
parse_str($input, $result);
62-
if ($result && isset($result['type'])) {
63-
self::dispatchWebhookEvent($result['type'], $result['data']);
64-
return $result;
65-
}
58+
{
59+
self::$receivedWebhook = $input;
60+
parse_str($input, $result);
61+
if ($result && isset($result['type'])) {
62+
self::dispatchWebhookEvent($result['type'], $result['data']);
63+
return $result;
6664
}
67-
65+
6866
return false;
6967
}
7068

0 commit comments

Comments
 (0)