Firefox error with link validation regex patterns

Created on 9 June 2023, over 1 year ago

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...

πŸ› Bug report
Status

Active

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States bob.hinrichs

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024