summaryrefslogtreecommitdiffstats
path: root/quips.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'quips.cgi')
-rwxr-xr-xquips.cgi20
1 files changed, 4 insertions, 16 deletions
diff --git a/quips.cgi b/quips.cgi
index f120e5a24..c36a09b6c 100755
--- a/quips.cgi
+++ b/quips.cgi
@@ -55,24 +55,12 @@ if ($action eq "show") {
}
if ($action eq "add") {
+ (Param('enablequips') eq "on") || ThrowUserError("no_new_quips");
+
# Add the quip
my $comment = $::FORM{"quip"};
- if (!$comment) {
- DisplayError("Please enter a quip in the text field.");
- exit();
- }
-
- if (Param('enablequips') ne "on") {
- ThrowUserError("no_new_quips");
- exit();
- }
-
-
- if ($comment =~ m/</) {
- DisplayError("Sorry - for security reasons, support for HTML tags has
- been turned off in quips.");
- exit();
- }
+ $comment || ThrowUserError("need_quip");
+ $comment !~ m/</ || ThrowUserError("no_html_in_quips");
SendSQL("INSERT INTO quips (userid, quip) VALUES (". $userid . ", " . SqlQuote($comment) . ")");