From: Tom Hughes Date: Fri, 3 Sep 2010 16:02:13 +0000 (+0100) Subject: Replace request.request_uri with request.fullpath X-Git-Tag: live~6673 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/7d45c2fd3c1a968de487de1afab947a06424d22b?hp=2bc44dfddc214efcec9dd2e920fac14a7c2dcec0 Replace request.request_uri with request.fullpath --- diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 2918354ff..904388b9d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -26,7 +26,7 @@ class ApplicationController < ActionController::Base if params[:referer] redirect_to :controller => "user", :action => "terms", :referer => params[:referer] else - redirect_to :controller => "user", :action => "terms", :referer => request.request_uri + redirect_to :controller => "user", :action => "terms", :referer => request.fullpath end end elsif session[:token] @@ -39,7 +39,7 @@ class ApplicationController < ActionController::Base end def require_user - redirect_to :controller => 'user', :action => 'login', :referer => request.request_uri unless @user + redirect_to :controller => 'user', :action => 'login', :referer => request.fullpath unless @user end ## diff --git a/app/controllers/message_controller.rb b/app/controllers/message_controller.rb index 8f67328e7..d97ca1bef 100644 --- a/app/controllers/message_controller.rb +++ b/app/controllers/message_controller.rb @@ -57,7 +57,7 @@ class MessageController < ApplicationController render :action => 'new' else flash[:notice] = t 'message.reply.wrong_user', :user => @user.display_name - redirect_to :controller => "user", :action => "login", :referer => request.request_uri + redirect_to :controller => "user", :action => "login", :referer => request.fullpath end rescue ActiveRecord::RecordNotFound @title = t'message.no_such_message.title' @@ -74,7 +74,7 @@ class MessageController < ApplicationController @message.save else flash[:notice] = t 'message.read.wrong_user', :user => @user.display_name - redirect_to :controller => "user", :action => "login", :referer => request.request_uri + redirect_to :controller => "user", :action => "login", :referer => request.fullpath end rescue ActiveRecord::RecordNotFound @title = t'message.no_such_message.title' diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 92b0f778a..6354ab478 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -74,7 +74,7 @@ class UserController < ApplicationController end else # Not logged in, so redirect to the login page - redirect_to :action => :login, :referer => request.request_uri + redirect_to :action => :login, :referer => request.fullpath end end end @@ -671,10 +671,10 @@ private if params[:display_name] redirect_to :controller => 'user', :action => 'view', :display_name => params[:display_name] else - redirect_to :controller => 'user', :action => 'login', :referer => request.request_uri + redirect_to :controller => 'user', :action => 'login', :referer => request.fullpath end elsif not @user - redirect_to :controller => 'user', :action => 'login', :referer => request.request_uri + redirect_to :controller => 'user', :action => 'login', :referer => request.fullpath end end diff --git a/app/views/diary_entry/view.html.erb b/app/views/diary_entry/view.html.erb index 63d43158d..b8621130a 100644 --- a/app/views/diary_entry/view.html.erb +++ b/app/views/diary_entry/view.html.erb @@ -22,5 +22,5 @@ <% end %> <%= if_not_logged_in(:div) do %> -

<%= t("diary_entry.view.login_to_leave_a_comment", :login_link => link_to(t("diary_entry.view.login"), :controller => 'user', :action => 'login', :referer => request.request_uri)) %>

+

<%= t("diary_entry.view.login_to_leave_a_comment", :login_link => link_to(t("diary_entry.view.login"), :controller => 'user', :action => 'login', :referer => request.fullpath)) %>

<% end %> diff --git a/app/views/layouts/site.html.erb b/app/views/layouts/site.html.erb index db3b4c6e3..ca4901311 100644 --- a/app/views/layouts/site.html.erb +++ b/app/views/layouts/site.html.erb @@ -18,9 +18,9 @@ <%= link_to t('layouts.welcome_user_link_tooltip'), {:controller => 'user', :action => 'view', :display_name => @user.display_name} %> | <%= yield :greeting %> <%= render :partial => "layouts/inbox" %> | - <%= link_to t('layouts.logout'), {:controller => 'user', :action => 'logout', :session => request.session_options[:id], :referer => request.request_uri}, {:id => 'logoutanchor', :title => t('layouts.logout_tooltip'), :method => :post, :href => url_for(:controller => 'user', :action => 'logout', :referer => request.request_uri)}%> + <%= link_to t('layouts.logout'), {:controller => 'user', :action => 'logout', :session => request.session_options[:id], :referer => request.fullpath}, {:id => 'logoutanchor', :title => t('layouts.logout_tooltip'), :method => :post, :href => url_for(:controller => 'user', :action => 'logout', :referer => request.fullpath)}%> <% else %> - <%= link_to t('layouts.log_in'), {:controller => 'user', :action => 'login', :referer => request.request_uri}, {:id => 'loginanchor', :title => t('layouts.log_in_tooltip')} %> | + <%= link_to t('layouts.log_in'), {:controller => 'user', :action => 'login', :referer => request.fullpath}, {:id => 'loginanchor', :title => t('layouts.log_in_tooltip')} %> | <%= link_to t('layouts.sign_up'), {:controller => 'user', :action => 'new'}, {:id => 'registeranchor', :title => t('layouts.sign_up_tooltip')} %> <% end %> diff --git a/app/views/message/_message_summary.html.erb b/app/views/message/_message_summary.html.erb index 1397d65af..f2021d2d5 100644 --- a/app/views/message/_message_summary.html.erb +++ b/app/views/message/_message_summary.html.erb @@ -10,5 +10,5 @@ <%= button_to t('message.message_summary.read_button'), {:controller => 'message', :action => 'mark', :message_id => message_summary.id, :mark => 'read'}, { :onclick => remote_function(:url => {:controller => 'message', :action => 'mark', :message_id => message_summary.id, :mark => 'read'}) + "; return false;" } %> <% end %> <%= button_to t('message.message_summary.reply_button'), :controller => 'message', :action => 'reply', :message_id => message_summary.id %> - <%= button_to t('message.message_summary.delete_button'), :controller => 'message', :action => 'delete', :message_id => message_summary.id, :referer => request.request_uri %> + <%= button_to t('message.message_summary.delete_button'), :controller => 'message', :action => 'delete', :message_id => message_summary.id, :referer => request.fullpath %> diff --git a/app/views/message/_sent_message_summary.html.erb b/app/views/message/_sent_message_summary.html.erb index d4d8b3fa5..f9aa2310d 100644 --- a/app/views/message/_sent_message_summary.html.erb +++ b/app/views/message/_sent_message_summary.html.erb @@ -4,5 +4,5 @@ <%= link_to h(sent_message_summary.recipient.display_name), :controller => 'user', :action => sent_message_summary.recipient.display_name %> <%= link_to h(sent_message_summary.title), :controller => 'message', :action => 'read', :message_id => sent_message_summary.id %> <%= l sent_message_summary.sent_on, :format => :friendly %> - <%= button_to t('message.sent_message_summary.delete_button'), :controller => 'message', :action => 'delete', :message_id => sent_message_summary.id, :referer => request.request_uri %> + <%= button_to t('message.sent_message_summary.delete_button'), :controller => 'message', :action => 'delete', :message_id => sent_message_summary.id, :referer => request.fullpath %> diff --git a/app/views/user/_contact.html.erb b/app/views/user/_contact.html.erb index d720353ee..9bac0dc2d 100644 --- a/app/views/user/_contact.html.erb +++ b/app/views/user/_contact.html.erb @@ -33,9 +33,9 @@ <%= link_to t('user.view.send message'), :controller => 'message', :action => 'new', :display_name => contact.display_name %> | <% if @user.is_friends_with?(contact) %> - <%= link_to t('user.view.remove as friend'), :controller => 'user', :action => 'remove_friend', :display_name => contact.display_name, :referer => request.request_uri %> + <%= link_to t('user.view.remove as friend'), :controller => 'user', :action => 'remove_friend', :display_name => contact.display_name, :referer => request.fullpath %> <% else %> - <%= link_to t('user.view.add as friend'), :controller => 'user', :action => 'make_friend', :display_name => contact.display_name, :referer => request.request_uri %> + <%= link_to t('user.view.add as friend'), :controller => 'user', :action => 'make_friend', :display_name => contact.display_name, :referer => request.fullpath %> <% end %> diff --git a/app/views/user_roles/grant.html.erb b/app/views/user_roles/grant.html.erb index f88ec2384..13f81184c 100644 --- a/app/views/user_roles/grant.html.erb +++ b/app/views/user_roles/grant.html.erb @@ -1,4 +1,4 @@ -<%= form_tag request.request_uri do %> +<%= form_tag request.fullpath do %> <%= hidden_field_tag 'nonce', @nonce %> <% @title = t('user_role.grant.heading') %>

<%= t('user_role.grant.heading') %>

diff --git a/app/views/user_roles/revoke.html.erb b/app/views/user_roles/revoke.html.erb index a31a6d81a..240a91fff 100644 --- a/app/views/user_roles/revoke.html.erb +++ b/app/views/user_roles/revoke.html.erb @@ -1,4 +1,4 @@ -<%= form_tag request.request_uri do %> +<%= form_tag request.fullpath do %> <%= hidden_field_tag 'nonce', @nonce %> <% @title = t('user_role.revoke.heading') %>

<%= t('user_role.revoke.heading') %>