Patch By Max Kanat-Alexander <mkanat@kerio.com> r=LpSolit, a=justdave
use Bugzilla::Util;
use Bugzilla::Error;
+use base qw(Exporter);
+@Bugzilla::Bug::EXPORT = qw(
+ ValidateComment
+);
+
+use constant MAX_COMMENT_LENGTH => 65535;
+
sub fields {
# Keep this ordering in sync with bugzilla.dtd
my @fields = qw(bug_id alias creation_ts short_desc delta_ts
return @dependencies;
}
+sub ValidateComment ($) {
+ my ($comment) = @_;
+
+ if (defined($comment) && length($comment) > MAX_COMMENT_LENGTH) {
+ ThrowUserError("comment_too_long");
+ }
+}
+
sub AUTOLOAD {
use vars qw($AUTOLOAD);
my $attr = $AUTOLOAD;
}
}
-sub ValidateComment {
- # Make sure a comment is not too large (greater than 64K).
-
- my ($comment) = @_;
-
- if (defined($comment) && length($comment) > 65535) {
- ThrowUserError("comment_too_long");
- }
-}
-
sub PasswordForLogin {
my ($login) = (@_);
SendSQL("select cryptpassword from profiles where login_name = " .
use Bugzilla::FlagType;
use Bugzilla::User;
use Bugzilla::Util;
+use Bugzilla::Bug;
# Check whether or not the user is logged in and, if so, set the $::userid
Bugzilla->login();