Skip to content

Business intelligence made simple

Added comments [skip ci]

Andrew Kane72af861476f1
diff --git a/app/mailers/blazer/slack_notifier.rb b/app/mailers/blazer/slack_notifier.rb
index 79ab6acb..7083b23f 100644
--- a/app/mailers/blazer/slack_notifier.rb
+++ b/app/mailers/blazer/slack_notifier.rb
@@ -60,6 +60,9 @@ module Blazer
ActionController::Base.helpers.pluralize(*args)
end
+ # checks shouldn't have variables, but in any case,
+ # avoid passing variable params to url helpers
+ # (known unsafe parameters are removed, but blacklist isn't ideal)
def self.query_url(id)
Blazer::Engine.routes.url_helpers.query_url(id, ActionMailer::Base.default_url_options)
end
diff --git a/app/views/blazer/check_mailer/failing_checks.html.erb b/app/views/blazer/check_mailer/failing_checks.html.erb
index d8c410ea..a0d03eee 100644
--- a/app/views/blazer/check_mailer/failing_checks.html.erb
+++ b/app/views/blazer/check_mailer/failing_checks.html.erb
@@ -1,5 +1,6 @@
<ul>
<% @checks.each do |check| %>
+ <%# check queries shouldn't have variables, but in any case, don't pass them to url helpers %>
<li><%= link_to check.query.name, query_url(check.query_id) %> <%= check.state %></li>
<% end %>
</ul>
diff --git a/app/views/blazer/check_mailer/state_change.html.erb b/app/views/blazer/check_mailer/state_change.html.erb
index 942aa32c..dce9ac61 100644
--- a/app/views/blazer/check_mailer/state_change.html.erb
+++ b/app/views/blazer/check_mailer/state_change.html.erb
@@ -2,6 +2,7 @@
<head>
</head>
<body style="font-family: 'Helvetica Neue', Arial, Helvetica; font-size: 14px; color: #333;">
+ <%# check queries shouldn't have variables, but in any case, don't pass them to url helpers %>
<p><%= link_to "View", query_url(@check.query_id) %></p>
<% if @error %>
<p><%= @error %></p>