[web-php] master: Display an error if no mailing list is selected (#392)

From: Date: Wed, 19 May 2021 19:05:45 +0000
Subject: [web-php] master: Display an error if no mailing list is selected (#392)
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-29312@lists.php.net to get a copy of this message
Author: Pavel Djundik (xPaw) Committer: GitHub (web-flow) Pusher: sgolemon Date: 2021-05-19T14:05:58-05:00 Commit: https://github.com/php/web-php/commit/7d6e63b6163e1991077822b71f7ba561e5171286 Raw diff: https://github.com/php/web-php/commit/7d6e63b6163e1991077822b71f7ba561e5171286.diff Display an error if no mailing list is selected (#392) Changed paths: M mailing-lists.php Diff: diff --git a/mailing-lists.php b/mailing-lists.php index 134a7b2cd..a608711cd 100644 --- a/mailing-lists.php +++ b/mailing-lists.php @@ -42,7 +42,7 @@ site_header("Mailing Lists", array("current" => "help")); // Some mailing list is selected for [un]subscription -if (isset($_POST['maillist'])) { +if (isset($_POST['action'])) { // No error found yet $error = ""; @@ -54,6 +54,12 @@ "<br>Please go back and try again."; } + // Check if any mailing list was selected + else if (empty($_POST['maillist'])) { + $error = "You need to select at least one mailing list to subscribe to." . + "<br>Please go back and try again."; + } + // Seems to be a valid email address else {

« previous php.webmaster (#29312) next »