Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm having trouble with some invalid javascript, which is breaking collapsible fieldsets and other things. The firebug console gives:
invalid quantifier
extExclude = new RegExp(Drupal.settings.extlink.extExclude.replace(/\\/, '\\'))
extlink.js (line 33)
I suppose this may be due to an invalid regular expression (I can't remember if I entered any), but the problem is I cannot edit it (that fieldset is broken because of the problem).
I tried disabling and uninstalling extlink, but when I enable the module again afterwards the problem returns. Could an (invalid) regular expression remain in the database after uninstalling? Otherwise there may be an incompatibility with Domain Access (I'm using different domains).
Comment | File | Size | Author |
---|---|---|---|
#7 | extlink-1434104-7.patch | 1.22 KB | elachlan |
#5 | extlink-rejexvalidate-1434104-5.patch | 1.92 KB | katbailey |
#3 | extlink-rejexvalidate-1434104-3.patch | 1.7 KB | arvinsingla |
Comments
Comment #1
quicksketchDisable JavaScript in your browser and empty our your regular expressions while JS is turned off.
Comment #2
ar-jan CreditAttribution: ar-jan commentedThanks, that worked. (Wondering: how come uninstalling and clearing cache didn't clear the regex?).
Comment #3
arvinsingla CreditAttribution: arvinsingla commentedI'm re-opening this issue as It seems there are two issues this brings up with external links that need to be addressed. First is that the module does not remove it's variables on uninstall, the second is that the include/exclude form fields are not being validated for proper regex. This can lead to the aforementioned javascript issues which have adverse affects on sites. I've made a patch that I think addresses these issues but needs to be reviewed as I'm not sure if I'm going about the rejex testing in a proper way, but it seems to work for the tests I've thrown at it.
Comment #4
quicksketchThanks, good suggestions. I'll review these next time I'm working on External Links.
Comment #5
katbailey CreditAttribution: katbailey commentedThis reroll, actually by Andrew Yang not me, fixes comments and tidies things up generally...
Comment #6
ar-jan CreditAttribution: ar-jan commentedThe patch in #5 applies cleanly to 7.x-1.12 (don't have git installed, no -dev release?).
I don't know if there are coding issues, but I've tested it for preventing invalid regular expressions, that seems to work. Setting to reviewed & tested to bump this ;).
Comment #7
elachlan CreditAttribution: elachlan commentedIssue #1203940: use hook_uninstall to completly remove extlink adds the hook_uninstall(). It is better to have separate issues and different commits.
I have re-rolled the patch.
Comment #8
elachlan CreditAttribution: elachlan commentedCommitted to Git for versions 6.x and 7.x.
Comment #9
elachlan CreditAttribution: elachlan commented