From 38635c645e5e7af59b39a6936c3280eaf999a221 Mon Sep 17 00:00:00 2001 From: CDuv <74853-CDuv@users.noreply.gitlab.com> Date: Wed, 8 May 2019 17:25:38 +0000 Subject: [PATCH] Adds quotes to Matomo/Piwik website ID When using Matomo/Piwik integration, only integer website IDs can be used. If using the "Protect Track ID" Matomo plugin (https://plugins.matomo.org/ProtectTrackID), website IDs are strings which the "_piwik.html.haml" layout file does not supports because it assumes "extra_config.piwik_site_id" variable contains an integer and prints it to JavaScript code without quotes. This commits surrounds "extra_config.piwik_site_id" variable with double quotes (") so that it works with both integers and strings. Issue: #61606 --- app/views/layouts/_piwik.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/_piwik.html.haml b/app/views/layouts/_piwik.html.haml index a888e8ae187..473b14ce626 100644 --- a/app/views/layouts/_piwik.html.haml +++ b/app/views/layouts/_piwik.html.haml @@ -7,7 +7,7 @@ (function() { var u="//#{extra_config.piwik_url}/"; _paq.push(['setTrackerUrl', u+'piwik.php']); - _paq.push(['setSiteId', #{extra_config.piwik_site_id}]); + _paq.push(['setSiteId', "#{extra_config.piwik_site_id}"]); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); })();