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

Command icon 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

bob.hinrichs created an issue. See original summary.

joe_carvajal’s picture

[Edited to remove this comment.]

joe_carvajal’s picture

Status: Active » Needs review
StatusFileSize
new951 bytes

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

joe_carvajal changed the visibility of the branch issue/clientside_validation-3365957-fix-regex-pattern to hidden.

joe_carvajal’s picture

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

nikunjkotecha’s picture

Status: Needs review » Needs work

@Joe can you please create MR? Check https://www.drupal.org/project/clientside_validation/issues/3504340 for example

j-barnes’s picture

Status: Needs work » Needs review

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

nikunjkotecha’s picture

Status: Needs review » Fixed

Thanks everyone

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.