Bug Tracker

Opened 11 years ago

Closed 10 years ago

#3251 closed bug (invalid)

[validate] .1 is considered an invalid number

Reported by: xyrka Owned by: joern
Priority: minor Milestone: 1.3
Component: plugin Version: 1.2.6
Keywords: validate Cc:
Blocked by: Blocking:

Description

A number such as .1 or anything that is .(number) comes up as invalid if the number rule is used.

Here is the regex currently used: /-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/ My modified one(probably could be more elegant): /(-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$)|(-?\.\d+$)/

Change History (3)

comment:1 Changed 11 years ago by xyrka

Woops didn't wrap my fix in a code block:

Current:

/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/

My fix:

/(^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$)|(^-?\.\d+$)/

comment:2 Changed 10 years ago by dmethvin

Owner: set to joern

comment:3 Changed 10 years ago by john

Resolution: invalid
Status: newclosed

Please file plugin bugs with the appropriate author on their bug tracker.

Note: See TracTickets for help on using tickets.