]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 308709: Misleading confirmation when entering an invalid sort key for a field...
authorSunil Joshi <joshi_sunil@in.com>
Wed, 19 Sep 2012 19:55:56 +0000 (21:55 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Wed, 19 Sep 2012 19:55:56 +0000 (21:55 +0200)
r/a=LpSolit

Bugzilla/Field/Choice.pm
template/en/default/global/user-error.html.tmpl

index 2b6d8195fadd30a7c486436fa4d14058fc3f3e81..52fb7b409652043418651e4daea988f5661424c7 100644 (file)
@@ -257,7 +257,7 @@ sub _check_sortkey {
     return 0 if !$value;
     # Store for the error message in case detaint_natural clears it.
     my $orig_value = $value;
-    detaint_natural($value)
+    (detaint_natural($value) && $value <= MAX_SMALLINT)
         || ThrowUserError('fieldvalue_sortkey_invalid',
                           { sortkey => $orig_value,
                             field   => $invocant->field });
index a8eabb0d70c9950c8af3c30ff4670728cbd957b8..91640fe4a47a43ac2dde6bb593a8b94f04b33361 100644 (file)
 
   [% ELSIF error == "fieldvalue_sortkey_invalid" %]
     [% title = "Invalid Field Value Sortkey" %]
-    The sortkey '[% sortkey FILTER html %]' for the 
-    [%+ field.description FILTER html %] field is not a valid 
-    (positive) number.
+    The sortkey '[% sortkey FILTER html %]' for the
+    [%+ field.description FILTER html %] field must be an integer
+    between 0 and [% constants.MAX_SMALLINT FILTER none %].
 
   [% ELSIF error == "fieldvalue_still_has_bugs" %]
     [% title = "You Cannot Delete This Field Value" %]