need to dup strings, some may be frozen

This commit is contained in:
Sam 2015-08-19 12:27:55 +10:00
parent 71644add2f
commit 431def1f52
1 changed files with 4 additions and 4 deletions

View File

@ -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