Permalink
Browse files

use better method for escaping redirect_uri params

  • Loading branch information...
1 parent cd0c969 commit d32388d2aab2490fa3b8883e23d4b8c09d71204b @thoughtless thoughtless committed Sep 24, 2010
Showing with 3 additions and 2 deletions.
  1. +1 −0 .rvmrc
  2. +2 −2 lib/mini_fb.rb
View
@@ -0,0 +1 @@
+rvm ree-1.8.7@mini-fb
View
@@ -493,7 +493,7 @@ def self.graph_base
def self.oauth_url(app_id, redirect_uri, options={})
oauth_url = "#{graph_base}oauth/authorize"
oauth_url << "?client_id=#{app_id}"
- oauth_url << "&redirect_uri=#{URI.escape(redirect_uri)}"
+ oauth_url << "&redirect_uri=#{CGI::escape(redirect_uri)}"
# oauth_url << "&scope=#{options[:scope]}" if options[:scope]
oauth_url << ("&" + options.map { |k, v| "%s=%s" % [k, v] }.join('&')) unless options.empty?
oauth_url
@@ -503,7 +503,7 @@ def self.oauth_url(app_id, redirect_uri, options={})
def self.oauth_access_token(app_id, redirect_uri, secret, code)
oauth_url = "#{graph_base}oauth/access_token"
oauth_url << "?client_id=#{app_id}"
- oauth_url << "&redirect_uri=#{URI.escape(redirect_uri)}"
+ oauth_url << "&redirect_uri=#{CGI::escape(redirect_uri)}"
oauth_url << "&client_secret=#{secret}"
oauth_url << "&code=#{URI.escape(code)}"
resp = RestClient.get oauth_url

0 comments on commit d32388d

Please sign in to comment.