Commit 471e23ea authored by Stan Hu's avatar Stan Hu

Fix CSP errors relating to matomo.js

Piwik was renamed to Matomo, and we introduced a settings fallback that
would use the old Piwik settings if available. The problem was that we
were always defining the Matomo config, even if the old settings were
not defined, so the HAML would always include this JavaScript.

We now only fall back to the Piwik settings only if they are defined.
parent cfb3cabc
......@@ -785,8 +785,8 @@ Settings.forti_authenticator['port'] = 443 if Settings.forti_authenticator['port
# Extra customization
#
Settings['extra'] ||= Settingslogic.new({})
Settings.extra['matomo_site_id'] ||= Settings.extra['piwik_site_id']
Settings.extra['matomo_url'] ||= Settings.extra['piwik_url']
Settings.extra['matomo_site_id'] ||= Settings.extra['piwik_site_id'] if Settings.extra['piwik_site_id'].present?
Settings.extra['matomo_url'] ||= Settings.extra['piwik_url'] if Settings.extra['piwik_url'].present?
#
# Rack::Attack settings
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment