User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:22.214.171.124) 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.
Created attachment 483682 [details] [diff] [review] Fixes the ID check to match the error message
Created attachment 483683 [details] [diff] [review] Fixes the ID check to match the error message (v2) Missed a spot. :(
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
Created attachment 521215 [details] [diff] [review] Add numbers to allowed regexp
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?
Created attachment 522343 [details] [diff] [review] Correct regexp and remove duplication of checks
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.