Skip to content

Commit

Permalink
Tightening error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
drewm committed Apr 23, 2016
1 parent 0553b8a commit f533674
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/Webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static function receive($input = null)
}
}

if ($input) {
if (!is_null($input) && $input != '') {
return self::processWebhook($input);
}

Expand All @@ -55,16 +55,14 @@ public static function receive($input = null)
* @return array|false An associative array containing the details of the received webhook
*/
private static function processWebhook($input)
{
if ($input) {
self::$receivedWebhook = $input;
parse_str($input, $result);
if ($result && isset($result['type'])) {
self::dispatchWebhookEvent($result['type'], $result['data']);
return $result;
}
{
self::$receivedWebhook = $input;
parse_str($input, $result);
if ($result && isset($result['type'])) {
self::dispatchWebhookEvent($result['type'], $result['data']);
return $result;
}

return false;
}

Expand Down

0 comments on commit f533674

Please sign in to comment.