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 {
 

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to