]> git.openstreetmap.org Git - rails.git/commitdiff
Improve recognition of OAuth referers for triggering of slim mode
authorTom Hughes <tom@compton.nu>
Wed, 6 Apr 2011 12:24:08 +0000 (13:24 +0100)
committerTom Hughes <tom@compton.nu>
Wed, 6 Apr 2011 12:24:08 +0000 (13:24 +0100)
app/controllers/user_controller.rb

index 649c0c9078792afc184c4961cbda6a0ef8c77094..72d60a307eda63e0cd9e947bf326000afb7061d6 100644 (file)
@@ -501,9 +501,11 @@ private
   # Choose the layout to use. See
   # https://rails.lighthouseapp.com/projects/8994/tickets/5371-layout-with-onlyexcept-options-makes-other-actions-render-without-layouts
   def choose_layout
+    oauth_url = url_for(:controller => :oauth, :action => :oauthorize, :only_path => true)
+
     if [ 'api_details' ].include? action_name
       nil
-    elsif params[:referer] == url_for(:controller => :oauth, :action => :oauthorize, :only_path => true)
+    elsif params[:referer] and URI.parse(params[:referer]).path == oauth_url
       'slim'
     else
       'site'