From 0930c074fa7d8dabed00af2ba39a177a8d00167f Mon Sep 17 00:00:00 2001 From: "myk%mozilla.org" <> Date: Mon, 11 Mar 2002 15:33:03 +0000 Subject: Fix for bug 72184: prevents users from entering too-large comments/descriptions that get rejected by MySQL's MAX_PACKET_SIZE restrictions. Patch by Myk Melez . r=bbaetz,gerv --- CGI.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'CGI.pl') diff --git a/CGI.pl b/CGI.pl index f91cbd670..0882a967c 100644 --- a/CGI.pl +++ b/CGI.pl @@ -324,6 +324,19 @@ sub ValidateBugID { } + +sub ValidateComment { + # Make sure a comment is not too large (greater than 64K). + + my ($comment) = @_; + + if (defined($comment) && length($comment) > 65535) { + DisplayError("Comments cannot be longer than 65,535 characters."); + exit; + } +} + + # check and see if a given string actually represents a positive # integer, and abort if not. # -- cgit v1.2.3-24-g4f1b