WPIntell

Source evidence

Custom Validation Messages containing quotes break JS!

Real Time Validation for Gravity Forms · support · 2019-05-02T09:02:00+00:00

complaintsentiment
mediumseverity
0.69relevance
0replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

5 / 25 rows with source links

20.0% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

20 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
Ben Huson unresolved
Testing with version 1.7.0 If I enter a Custom Validation for a field containing a quote (“), it breaks JS. This happens because the quote is not escaped in JS causing the following JS Error: SyntaxError: Unexpected identifier 'Title'. Expected '}' to end an object literal. ..as the following JS is invalid because of the quotes around “Title”: { failureMessage: "The "Title" field is required.",validMessage: " " ,jqObj: jqr } The error messages need to be escape using esc_js() when output in JavaScript to product the correct output: "The "Title" field is required." I am happy to provide a patch file or submit a PR if you have a GitHub account. Kind regards Ben This topic was modified 7 years ago by Ben Huson .

Comments

0 shown

No comments were stored for this source.