mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:11:08 +08:00
Add rubocop to our build. (#5004)
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
# The alternative is a broken website when this happens
|
||||
|
||||
class ActiveSupport::SafeBuffer
|
||||
def concat(value, raise_encoding_err=false)
|
||||
def concat(value, raise_encoding_err = false)
|
||||
if !html_safe? || value.html_safe?
|
||||
super(value)
|
||||
else
|
||||
@ -22,8 +22,8 @@ class ActiveSupport::SafeBuffer
|
||||
|
||||
self.force_encoding("UTF-8")
|
||||
unless valid_encoding?
|
||||
encode!("utf-16","utf-8",:invalid => :replace)
|
||||
encode!("utf-8","utf-16")
|
||||
encode!("utf-16", "utf-8", invalid: :replace)
|
||||
encode!("utf-8", "utf-16")
|
||||
end
|
||||
Rails.logger.warn("Encountered a non UTF-8 string in SafeBuffer - #{self} - #{encoding_diags}")
|
||||
end
|
||||
@ -36,7 +36,7 @@ class ActiveSupport::SafeBuffer
|
||||
Rails.logger.warn("Attempted to concat a non UTF-8 string in SafeBuffer - #{value} - #{encoding_diags}")
|
||||
end
|
||||
|
||||
concat(value,_raise=true)
|
||||
concat(value, _raise = true)
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user