mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 05:01:05 +08:00
DEV: Apply suggested changes
This commit is contained in:
parent
1fffb236b2
commit
30ae313dec
|
@ -5,8 +5,7 @@ module HttpUserAgentEncoder
|
|||
return "" unless user_agent
|
||||
|
||||
if user_agent.encoding != Encoding::UTF_8
|
||||
user_agent = user_agent.encode("utf-8", invalid: :replace, undef: :replace)
|
||||
user_agent.scrub!
|
||||
user_agent = user_agent.encode!("utf-8", invalid: :replace, undef: :replace).scrub!
|
||||
end
|
||||
|
||||
user_agent || ""
|
||||
|
|
Loading…
Reference in New Issue
Block a user