]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 578324: The "Hours Worked" field in show_bug.cgi rejects all values passed to...
authorFrédéric Buclin <LpSolit@gmail.com>
Tue, 13 Jul 2010 22:49:35 +0000 (00:49 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Tue, 13 Jul 2010 22:49:35 +0000 (00:49 +0200)
r/a=mkanat

Bugzilla/Bug.pm

index ecd00ff0194ad18d448549cedcbcebf3c8f7f952..3c7eb3d5c26df41e0745e3c1a31e1f9bdae0f722 100644 (file)
@@ -50,7 +50,7 @@ use Bugzilla::Status;
 use Bugzilla::Comment;
 
 use List::MoreUtils qw(firstidx uniq);
-use List::Util qw(min first);
+use List::Util qw(min max first);
 use Storable qw(dclone);
 use URI;
 use URI::QueryParam;
@@ -2628,7 +2628,7 @@ sub add_comment {
     # later in set_all. But if they haven't, this keeps remaining_time
     # up-to-date.
     if ($params->{work_time}) {
-        $self->set_remaining_time($self->remaining_time - $params->{work_time});
+        $self->set_remaining_time(max($self->remaining_time - $params->{work_time}, 0));
     }
 
     # So we really want to comment. Make sure we are allowed to do so.