Closed Bug 604830 Opened 15 years ago Closed 14 years ago

Plugin ID invalid message doesn't match the test

Categories

(Other Applications Graveyard :: ChatZilla, defect)

defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sandreas41, Assigned: bugzilla-mozilla-20000923)

Details

(Whiteboard: [cz-0.9.87])

Attachments

(1 file, 3 obsolete files)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.19) Gecko/20090102 SeaMonkey/1.1.14 Build Identifier: ChatZilla 0.9.86 [SeaMonkey 1.1.14/0000000000] According to the error message, an ID can contain alphanumeric characters, dash (_) and hyphen (-). According to the code, an ID can contain alphabetic characters (no numbers), dash (_) and hyphen (-). Oops? Reproducible: Always Steps to Reproduce: 1. In a plugin, set: plugin.id = "seamonkey-1_1_14-menu-fix"; (for example) 2. Attempt to load plugin Actual Results: Plugin <...> does not have a valid id. Plugin ids may only contain alphanumeric characters, underscores (_) and dashes (-). Expected Results: Plugin “seamonkey-1_1_14-menu-fix” is now enabled.
Attachment #483682 - Flags: review?
Missed a spot. :(
Attachment #483682 - Attachment is obsolete: true
Attachment #483683 - Flags: review?(gijskruitbosch+bugs)
Attachment #483682 - Flags: review?
It would be preferable to refactor that bit of code so that the conditions aren't all repeated. Also, \w includes \d. Assuming your intention was to force the ID to start with a letter, the regex you want is /^[A-Za-z][\w-]*$/
Assignee: rginda → sandreas41
Severity: normal → minor
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attached patch Add numbers to allowed regexp (obsolete) — Splinter Review
Assignee: sandreas41 → silver
Attachment #483683 - Attachment is obsolete: true
Attachment #521215 - Flags: review?(samuel)
Attachment #483683 - Flags: review?(gijskruitbosch+bugs)
Comment on attachment 521215 [details] [diff] [review] Add numbers to allowed regexp It's a little odd that we're checking all the conditions twice... (Yes, I do kind of see the reason for it there.)
Attachment #521215 - Flags: review?(samuel) → review+
Why not just match it once and save the result in a local variable?
Attachment #521215 - Attachment is obsolete: true
Attachment #522343 - Flags: review?(samuel)
Attachment #522343 - Flags: review?(samuel) → review+
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [cz-0.9.87]
Product: Other Applications → Other Applications Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: