diff --git a/lib/email.rb b/lib/email.rb index d0029b3d0c0..06413f0f256 100644 --- a/lib/email.rb +++ b/lib/email.rb @@ -23,7 +23,7 @@ module Email def self.cleanup_alias(name) # TODO: I'm sure there are more, but I can't find a list - name ? name.gsub(/[:<>]/, '') : name + name ? name.gsub(/[:<>,]/, '') : name end end diff --git a/spec/components/email/message_builder_spec.rb b/spec/components/email/message_builder_spec.rb index 8586416f418..bdadaed3ee8 100644 --- a/spec/components/email/message_builder_spec.rb +++ b/spec/components/email/message_builder_spec.rb @@ -58,7 +58,7 @@ describe Email::MessageBuilder do end it "cleans up the site title" do - SiteSetting.stubs(:title).returns(">>>Obnoxious Title: Deal With It<<<") + SiteSetting.stubs(:title).returns(">>>Obnoxious Title: Deal, With It<<<") expect(reply_by_email_builder.header_args['Reply-To']).to eq("Obnoxious Title Deal With It ") end end @@ -253,12 +253,12 @@ describe Email::MessageBuilder do end it "cleans up aliases in the from_alias arg" do - builder = Email::MessageBuilder.new(to_address, from_alias: "Finn: the Dog <3", from: finn_email) + builder = Email::MessageBuilder.new(to_address, from_alias: "Finn: the Dog, <3", from: finn_email) builder.build_args[:from].should == "Finn the Dog 3 <#{finn_email}>" end it "cleans up the email_site_title" do - SiteSetting.stubs(:email_site_title).returns("::>>>Best Forum EU: Award Winning<<<") + SiteSetting.stubs(:email_site_title).returns("::>>>Best Forum, EU: Award Winning<<<") expect(build_args[:from]).to eq("Best Forum EU Award Winning <#{SiteSetting.notification_email}>") end