Handle UTF-8 correctly in monkey patched OAuth::Helper.escape
Fixes #3185
This commit is contained in:
parent
384c83a248
commit
89456c8b40
1 changed files with 5 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
|||
require "oauth/controllers/provider_controller"
|
||||
require "oauth/helper"
|
||||
require "oauth/rack/oauth_filter"
|
||||
|
||||
Rails.configuration.middleware.use OAuth::Rack::OAuthFilter
|
||||
|
@ -7,8 +8,10 @@ module OAuth
|
|||
module Helper
|
||||
def escape(value)
|
||||
value.to_s.gsub(OAuth::RESERVED_CHARACTERS) do |c|
|
||||
format("%%%02X", c.ord)
|
||||
end
|
||||
c.bytes.map do |b|
|
||||
format("%%%02X", b)
|
||||
end.join
|
||||
end.force_encoding(Encoding::US_ASCII)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue