From e20dfbeafb326b06639ed9ceb3f57d864e1a87e9 Mon Sep 17 00:00:00 2001 From: Amaury Vallier Date: Mon, 28 May 2018 11:15:17 +0200 Subject: [PATCH] Fixed JS syntax errors on cookiePath Currrently, if the cookiePath is null as per the configuration, we get a SyntaxError ("Unexpected token }" or "expected expression, got '}'" depending on the browser) and if it is defined (to '/' for example as in the doc) we have another SyntaxError ("invalid escape sequence" or "Invalid or unexpected token" depending on the browser). Simply escaping the value solves both cases for me. --- Resources/views/privacycookie.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/views/privacycookie.html.twig b/Resources/views/privacycookie.html.twig index 4312b76..da0fb3c 100644 --- a/Resources/views/privacycookie.html.twig +++ b/Resources/views/privacycookie.html.twig @@ -21,7 +21,7 @@ var privacyCookieBanner = new eZ.PrivacyCookieBanner({ cookieName: '{{ cookieName }}', days: {{ cookieValidity }}, - path: {{ cookiePath }} + path: '{{ cookiePath }}' }); setTimeout(function () { privacyCookieBanner.show()