[webhook] treat github api errors when validating users better. (#70219)

Proper fix is to make apisend handle retrying but i can't pr that from in bed when i remember i forgot to look into this so here we are
This commit is contained in:
Kyle Spier-Swenson
2022-10-03 20:16:06 -07:00
committed by GitHub
parent 9ab417fd58
commit 23a58ba321
@@ -186,7 +186,7 @@ function validate_user($payload) {
$querystring .= ($querystring == '' ? '' : '+') . urlencode($key) . ':' . urlencode($value);
$res = github_apisend('https://api.github.com/search/issues?q='.$querystring);
$res = json_decode($res, TRUE);
return $res['total_count'] >= (int)$validation_count;
return (isset($res['total_count']) && $res['total_count'] >= (int)$validation_count);
}