Reply 15892 to: Escape javascript variable ?

Avatar: stear
stear
Participant
September 17, 2014 at 14:36

I’ve already fixed the problem by changing the translated string.

The problem is in your php generated javascript code for add to cart ajax.

example

var successfullyAdded = ‘successfully added to your shopping cart’;

The variable isn’t escaped so if there is a quote in the translated string there will be a javascript syntax error.

Go To The Whole Conversation In Topic
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.