From b77c6fe8ae31b582e68f3d58391176e43b523023 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 6 Apr 2011 13:24:08 +0100 Subject: [PATCH] Improve recognition of OAuth referers for triggering of slim mode --- app/controllers/user_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 649c0c907..72d60a307 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -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' -- 2.43.2