This is easily reproducible:
In a field where the patterns in \Drupal\clientside_validation\Plugin\CvValidator\UrlInternalExternal::addValidation are used to evaluate a URL, a jquery error in firefox results: "Unable to check |\/.*|\?.*|#.*|[hH][tT][Tt][pP][sS]?://.+|.*\(\d+\)'> because the pattern is not a valid regexp: invalid identity escape in regular expression" - visible in the console of devtools.
If you remove the backslashes before the angle brackets in \ within the pattern in the method, the error goes away. This change does not cause errors to be reported in Chrome. Note that I am not able to check to see if this impacts the effectiveness of the module.
There are other cases reported of this kind of thing with firefox's regex, e.g. https://itecnote.com/tecnote/html-firefox-error-unable-to-check-input-be...
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3365954-3-firefox-error-with-link-validation-regex-patterns.patch | 951 bytes | joe_carvajal |
Issue fork clientside_validation-3365954
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
joe_carvajal[Edited to remove this comment.]
Comment #3
joe_carvajalI had this issue in 4.1.1 and @bob.hinrichs is right.
Here's a patch with that change, the errors are gone and seems to be working fine.
Comment #5
joe_carvajalI created it as a merge request also.
First time doing it this way for a contrib module, not sure if this is done well
https://git.drupalcode.org/issue/clientside_validation-3365954/-/compare...
Comment #6
nikunjkotecha@Joe can you please create MR? Check https://www.drupal.org/project/clientside_validation/issues/3504340 for example
Comment #8
j-barnes commented@Joe - Thanks for the contribution, this is working great for our team. Created the MR for this so we can hopefully get it merged soon.
Comment #10
nikunjkotechaThanks everyone