Addon version check is too strict

RESOLVED FIXED in Future

Status

P5
trivial
RESOLVED FIXED
8 years ago
3 years ago

People

(Reporter: rimas, Unassigned)

Tracking

unspecified
Future

Details

(URL)

(Reporter)

Description

8 years ago
According to https://developer.mozilla.org/en/Toolkit_version_format, each part of the addon version string consists of four non-mandatory parts:

<number-a><string-b><number-c><string-d>

However, the current version checking regexp is like this:
/^\d+(\+|\w+)?(\.\d+(\+|\w+)?)*$/
which is incorrect, because:
1) it assumes the <number-a> part is always present,
2) it treats parts <number-c> and <string-d> as invalid, and
3) (\+|\w+) is actually too limiting for string parts which are specified as ASCII strings.

This should be fixed, because right now, it's basically impossible to upload an add-on with a version component like .vcs20100923 .

As few a side notes:
1) that vague specification of string parts leaves me wondering whether or not they can contain digits
2) if they cant' then it's a little weird that versions like 1.2.1+vcs20100923 are specified to be treated as lower than 1.2.1 while 1.2.1+20100923 is higher, but if they can, this would be a little ambigous.
Severity: normal → trivial
Priority: -- → P5
Target Milestone: --- → Future
According to bug 641087 we allow /[A-Za-z0-9+*.-]+/
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
(Assignee)

Updated

3 years ago
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.