aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/admin_request_controller.rb2
-rw-r--r--app/models/request_mailer.rb6
-rw-r--r--app/views/admin_request/hidden_user_explanation.rhtml3
-rw-r--r--app/views/contact_mailer/from_admin_message.rhtml2
-rwxr-xr-xscript/runner6
5 files changed, 10 insertions, 9 deletions
diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb
index e39d55c7c..ed8de7755 100644
--- a/app/controllers/admin_request_controller.rb
+++ b/app/controllers/admin_request_controller.rb
@@ -379,7 +379,7 @@ class AdminRequestController < AdminController
ContactMailer.deliver_from_admin_message(
info_request.user,
subject,
- params[:explanation]
+ params[:explanation].strip.html_safe
)
flash[:notice] = _("Your message to {{recipient_user_name}} has been sent",:recipient_user_name=>CGI.escapeHTML(info_request.user.name))
else
diff --git a/app/models/request_mailer.rb b/app/models/request_mailer.rb
index 493d6961c..dc2c5fe21 100644
--- a/app/models/request_mailer.rb
+++ b/app/models/request_mailer.rb
@@ -5,7 +5,11 @@
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
require 'alaveteli_file_types'
-
+if Rails.env == 'test' && RUBY_VERSION.to_f >= 1.9
+ # Avoid spec/script/mailin_spec.rb running script/runner as a test suite
+ # http://stackoverflow.com/questions/1899009/why-are-tests-running-in-production-mode-and-causing-my-script-runners-to-fail
+ Test::Unit.run = true
+end
class RequestMailer < ApplicationMailer
diff --git a/app/views/admin_request/hidden_user_explanation.rhtml b/app/views/admin_request/hidden_user_explanation.rhtml
index 64387ffee..7084e986f 100644
--- a/app/views/admin_request/hidden_user_explanation.rhtml
+++ b/app/views/admin_request/hidden_user_explanation.rhtml
@@ -1,9 +1,10 @@
Dear <%= name_to %>,
-Your request '<%= info_request.title %>' at <%= info_request_url %> has been reviewed by moderators.
+Your request '<%= info_request.title.html_safe %>' at <%= info_request_url %> has been reviewed by moderators.
We consider it <% if reason == 'not_foi' %>is not a valid FOI request<% else %>to be vexatious<% end%>, and have therefore hidden it from other users. You will still be able to view it while logged in to the site. Please reply to this email if you would like to discuss this decision further.
Yours,
The <%= site_name %> team.
+
diff --git a/app/views/contact_mailer/from_admin_message.rhtml b/app/views/contact_mailer/from_admin_message.rhtml
index bdb48d580..43938e0dd 100644
--- a/app/views/contact_mailer/from_admin_message.rhtml
+++ b/app/views/contact_mailer/from_admin_message.rhtml
@@ -1,2 +1,2 @@
-<%= @message.strip %>
+<%= @message %>
diff --git a/script/runner b/script/runner
index cb34f9187..1575848de 100755
--- a/script/runner
+++ b/script/runner
@@ -1,11 +1,7 @@
#!/usr/bin/env ruby
daemon_mode = !ARGV.empty? && ARGV[0] == "--daemon"
-if Rails.env == 'test'
- # Avoid spec/script/mailin_spec.rb running script/runner as a test suite
- # http://stackoverflow.com/questions/1899009/why-are-tests-running-in-production-mode-and-causing-my-script-runners-to-fail
- Test::Unit.run = true
-end
+
script_dir = File.dirname(__FILE__)
alaveteli_dir = File.expand_path(File.join(script_dir, ".."))