]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
ids.cgi: Fix regular expression to check for valid email addresses
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 11 Aug 2025 11:04:06 +0000 (12:04 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 3 Sep 2025 17:42:01 +0000 (18:42 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/ids.cgi

index 8b14baad5eb43c01c1051cd995a0a31490a3db13..362cbec87414e55daf5ab6e5b79b3a1a2340a211 100644 (file)
@@ -2127,8 +2127,9 @@ sub _validate_mail_address($) {
 
        # Loop through the array of mail addresses.
        foreach my $addr (@temp) {
-               # Return 1 if the processed mail address is invalid.
-               return 1 unless($addr =~ '^([a-zA-Z][\w\_\.]{6,15})\@([a-zA-Z0-9.-]+)\.([a-zA-Z]{2,4})$');
+               # If the address contains a '@' with at least one character before and after,
+               # we consider it valid.
+               return 1 unless ($address =~ m/.@./);
        }
 
        # Return nothing if the address is valid.