]> 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:57:09 +0000 (21:57 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Wed, 19 Sep 2012 19:57:09 +0000 (21:57 +0200)
r/a=LpSolit

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

index 8c5873fdb171e6d9a7741bb1dc916d207ac5d68e..a292185c461f2129d3da94544a0f0e22c1768c2f 100644 (file)
@@ -256,7 +256,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 41205ccb6bbf7bd20ffc135a936816f73cef5c0a..990ffddfc8b2b1fee7f69785dc6aefbbdd150145 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" %]