mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 09:26:54 -06:00
need to dup strings, some may be frozen
This commit is contained in:
parent
71644add2f
commit
431def1f52
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user