Closed Bug 1198659 Opened 9 years ago Closed 9 years ago

Custom fields of type INTEGER should accept negative integers

Categories

(Bugzilla :: Administration, task)

task
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 5.0

People

(Reporter: LpSolit, Assigned: LpSolit)

References

Details

Attachments

(1 file, 1 obsolete file)

The backend code for custom fields of type INTEGER accepts negative integers via detaint_signed(), but the frontend code doesn't as it uses \d+ to validate the data entered by the user. This is inconsistent. As the backend code accepts negative integers, there is no reason for such a limitation in the frontend.
Attached patch patch, v1 (obsolete) — Splinter Review
The pattern must match -?\d+ instead of \d+ to accept negative numbers. I also added a title as at least Firefox uses it to display which data format is expected if the value doesn't match the pattern.
Attachment #8652784 - Flags: review?(gerv)
Attached patch patch, v1.1Splinter Review
The backend code accepts negative numbers, but should compare the absolute value, else very large negative numbers would crash PostgreSQL.
Attachment #8652784 - Attachment is obsolete: true
Attachment #8652784 - Flags: review?(gerv)
Attachment #8652785 - Flags: review?(gerv)
Comment on attachment 8652785 [details] [diff] [review]
patch, v1.1

Review of attachment 8652785 [details] [diff] [review]:
-----------------------------------------------------------------

r=gerv.

Gerv
Attachment #8652785 - Flags: review?(gerv) → review+
Flags: approval?
Flags: approval5.0?
Flags: approval?
Flags: approval5.0?
Flags: approval5.0+
Flags: approval+
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
   4b3f99a..4864903  master -> master

To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
   7d3c1b0..ea25c5c  5.0 -> 5.0
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: