User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:184.108.40.206) 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-]*$/
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.)
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