mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 23:48:45 +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
|
return "" unless user_agent
|
||||||
|
|
||||||
if user_agent.encoding != Encoding::UTF_8
|
if user_agent.encoding != Encoding::UTF_8
|
||||||
user_agent = user_agent.encode("utf-8", invalid: :replace, undef: :replace)
|
user_agent = user_agent.encode!("utf-8", invalid: :replace, undef: :replace).scrub!
|
||||||
user_agent.scrub!
|
|
||||||
end
|
end
|
||||||
|
|
||||||
user_agent || ""
|
user_agent || ""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user