Commit f333f43a authored by Felix Schäfer's avatar Felix Schäfer

[#736] force recipients/cc to arrays in the Mailer

String#delete might break on 1.9 with dashes in the author's email address. Furthermore, String#delete doesn't do what the original author thought it does.
parent add0bf4d
......@@ -396,8 +396,8 @@ class Mailer < ActionMailer::Base
# if he doesn't want to receive notifications about what he does
@author ||= User.current
if @author.pref[:no_self_notified]
recipients.delete(@author.mail) if recipients
cc.delete(@author.mail) if cc
recipients((recipients.is_a?(Array) ? recipients : [recipients]) - [@author.mail]) if recipients
cc((cc.is_a?(Array) ? cc : [cc]) - [@author.mail]) if cc
notified_users = [recipients, cc].flatten.compact.uniq
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