From 431def1f52669e2c2c117d05b788cbf9c345915b Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 19 Aug 2015 12:27:55 +1000 Subject: [PATCH] need to dup strings, some may be frozen --- lib/post_creator.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/post_creator.rb b/lib/post_creator.rb index 52bd0621fea..089d13f61db 100644 --- a/lib/post_creator.rb +++ b/lib/post_creator.rb @@ -54,13 +54,13 @@ class PostCreator # If we don't do this we introduce a rather risky dependency @user = user @opts = opts || {} - pg_clean_up!(opts[:title]) - pg_clean_up!(opts[:raw]) + opts[:title] = pg_clean_up(opts[:title]) if opts[:title] + opts[:raw] = pg_clean_up(opts[:raw]) if opts[:raw] @spam = false end - def pg_clean_up!(str) - str.gsub!("\u0000", "") if str + def pg_clean_up(str) + str.gsub("\u0000", "") end # True if the post was considered spam