From e62fce85fdd92f925921a7f367d7a2edbc318430 Mon Sep 17 00:00:00 2001 From: swaggboi Date: Sun, 2 May 2021 19:32:36 -0400 Subject: [PATCH] Latest guestbook++ --- cgi-bin/guest_mm.cgi | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cgi-bin/guest_mm.cgi b/cgi-bin/guest_mm.cgi index 640f925..6651d02 100755 --- a/cgi-bin/guest_mm.cgi +++ b/cgi-bin/guest_mm.cgi @@ -19,9 +19,8 @@ use WebService::Mattermost; # Create CGI object (query) my $q = CGI->new(); -# Open banned phrases file +# Open banned phrases and users files open(my $thoughtCrimes, '.msg.bans') or die "$@"; -# Open banned users file open(my $nameBans, '.name.bans') or die "$@"; # Get creds file @@ -127,9 +126,11 @@ sub params_in { # Enforce max length for params if (length($name) < 1 || (length($name) >= 40)) { die "Name field must be between 1 and 40 characters\n" - } elsif (length($location) < 1 || length($location) >= 40) { + } + elsif (length($location) < 1 || length($location) >= 40) { die "Location field must be between 1 and 40 characters\n" - } elsif (length($message) < 1 || length($message) >= 1900) { + } + elsif (length($message) < 1 || length($message) >= 1900) { die "Message field must be between 1 and 1900 characters\n" } @@ -194,6 +195,7 @@ print $q->header(-charset => 'UTF-8'); # Print the head & title, begin the body print $q->start_html( + -dtd => 'html', -title => 'SwaggNet Guestbook', -style => '/css/swagg.css' ); @@ -207,7 +209,7 @@ print $q->div( ) . "\n"; # Process returned params if present; else print form -($q->param()) ? params_in() : form_out(); +$q->param() ? params_in() : form_out(); # Print link to go back to homepage in footer print $q->div(