[MIRROR] [webhook] treat github api errors when validating users better. [MDB IGNORE] (#16625)

* [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

* [webhook] treat github api errors when validating users better.

Co-authored-by: Kyle Spier-Swenson <kyleshome@gmail.com>
This commit is contained in:
SkyratBot
2022-10-04 15:46:19 +02:00
committed by GitHub
parent 9d0cb64993
commit f6725c2373

View File

@@ -185,7 +185,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);
}