Closed Bug 370510 Opened 18 years ago Closed 17 years ago

Extension upload rejects valid extension versions

Categories

(addons.mozilla.org Graveyard :: Developer Pages, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jwkbugzilla, Unassigned)

References

()

Details

Just got the following message when testing extension upload: "The version of this add-on is invalid: please see the specification". It seems the regular expression used here is /^\d+(\.\d+){0,3}$/ (/app/controllers/components/developers.php). Even the outdated specification cited (Firefox 1.0 version number format) allows to use "+" at the end of the version number, Firefox 1.5 version numbers are far more flexible. The version numbers I use for development builds have the form 0.7.2.4+.2007020523 - perfectly valid.
The regex is from bug 299479. What pattern would you suggest instead?
/^\d+(\+|\w+)?(\.\d+(\+|\w+)?)*$/
(In reply to comment #2) > /^\d+(\+|\w+)?(\.\d+(\+|\w+)?)*$/ > shaver: r+?
That regex doesn't look like it'd permit 1.5pre4 which is also a valid format according to the doc Wladimir linked. r=shaver on any regex that passes all the right tests, though! :)
RyanJones pointed out that I'm wrong, and it does permit that, so yeah, I guess that's fine!
Assignee: nobody → fligtar
Changed regex and updated specification link in r2191
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Confirmed, works now.
AMO isn't accepting 1.0.0b4.r5 as a version format due to the version part beginning with a letter instead of a number (".r5"). As far as I can tell from the spec, this should be allowed, since all four parts of the version part are optional (and it installs fine in Firefox). /^\d+(\+|\w+)?(\.((\d+(\+|\w+)?)|\w+))*$/ would work.
Reopening because problem is back, see comment #9
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Absolutely any string can be parsed as a version, so I suggest you remove the regex altogether
Assignee: fligtar → nobody
Status: REOPENED → NEW
I think this is somewhere we want to disagree with Firefox. Although any string might be able to be used as a version in Firefox, I'd rather AMO stick with a consistent pattern that is ubiquitous. Having said that, marking FIXED again - I think we should keep the existing regex.
Status: NEW → RESOLVED
Closed: 18 years ago17 years ago
Resolution: --- → FIXED
Why not warn instead of erroring out? What is the problem you're trying to protect against?
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.