Author: Nikita Popov (nikic)
Date: 2021-12-05T16:23:41+01:00
Commit:
https://github.com/php/web-master/commit/5b065910a3df1f78bb1428bdd6d415013e85a3b0
Raw diff:
https://github.com/php/web-master/commit/5b065910a3df1f78bb1428bdd6d415013e85a3b0.diff
Don't send mail if no mailing list specified
Changed paths:
M public/github-webhook.php
Diff:
diff --git a/public/github-webhook.php b/public/github-webhook.php
index 36a5e70..491d2b4 100644
--- a/public/github-webhook.php
+++ b/public/github-webhook.php
@@ -345,6 +345,11 @@ function handle_push_mail($payload) {
$isPR = is_pr($issue);
$to = get_issue_mailing_list($repoName, $isPR);
+ if ($to === null) {
+ echo "Not sending mail for $repoName (no mailing list)";
+ return;
+ }
+
$subject = prep_title($issue, $repoName);
$type = $isPR ? 'Pull Request' : 'Issue';
@@ -386,6 +391,11 @@ function handle_push_mail($payload) {
$isPR = is_pr($issue);
$to = get_issue_mailing_list($repoName, $isPR);
+ if ($to === null) {
+ echo "Not sending mail for $repoName (no mailing list)";
+ return;
+ }
+
$subject = prep_title($issue, $repoName);
$type = $isPR ? 'Pull Request' : 'Issue';
--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php