From f4e7765e0101dcc869d0457bf581932c3c024944 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 10 Jul 2016 19:55:07 +0000 Subject: [PATCH] Don't generate urls with params. git-svn-id: http://svn.redmine.org/redmine/trunk@15632 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/routes_helper.rb | 8 ++++++++ app/views/activities/index.html.erb | 2 +- app/views/common/feed.atom.builder | 4 ++-- app/views/news/index.html.erb | 2 +- app/views/repositories/entry.html.erb | 6 +++++- app/views/repositories/revisions.html.erb | 4 ++-- app/views/repositories/show.html.erb | 7 ++++--- 7 files changed, 23 insertions(+), 10 deletions(-) diff --git a/app/helpers/routes_helper.rb b/app/helpers/routes_helper.rb index b8415a510..85d60a28a 100644 --- a/app/helpers/routes_helper.rb +++ b/app/helpers/routes_helper.rb @@ -29,6 +29,14 @@ module RoutesHelper end end + def _project_news_path(project, *args) + if project + project_news_index_path(project, *args) + else + news_index_path(*args) + end + end + def _new_project_issue_path(project, *args) if project new_project_issue_path(project, *args) diff --git a/app/views/activities/index.html.erb b/app/views/activities/index.html.erb index d939fdc79..8f5cd08e6 100644 --- a/app/views/activities/index.html.erb +++ b/app/views/activities/index.html.erb @@ -42,7 +42,7 @@ <% end %> <% content_for :header_tags do %> -<%= auto_discovery_link_tag(:atom, params.merge(:format => 'atom', :from => nil, :key => User.current.rss_key)) %> +<%= auto_discovery_link_tag(:atom, :params => request.query_parameters.merge(:from => nil, :key => User.current.rss_key), :format => 'atom') %> <% end %> <% content_for :sidebar do %> diff --git a/app/views/common/feed.atom.builder b/app/views/common/feed.atom.builder index 74cebc582..893400dea 100644 --- a/app/views/common/feed.atom.builder +++ b/app/views/common/feed.atom.builder @@ -1,8 +1,8 @@ xml.instruct! xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do xml.title truncate_single_line_raw(@title, 100) - xml.link "rel" => "self", "href" => url_for(params.merge(:only_path => false)) - xml.link "rel" => "alternate", "href" => url_for(params.merge(:only_path => false, :format => nil, :key => nil)) + xml.link "rel" => "self", "href" => url_for(:params => request.query_parameters, :only_path => false, :format => 'atom') + xml.link "rel" => "alternate", "href" => url_for(:params => request.query_parameters.merge(:format => nil, :key => nil), :only_path => false) xml.id home_url xml.icon favicon_url xml.updated((@items.first ? @items.first.event_datetime : Time.now).xmlschema) diff --git a/app/views/news/index.html.erb b/app/views/news/index.html.erb index 64614c154..2ff5a1c8c 100644 --- a/app/views/news/index.html.erb +++ b/app/views/news/index.html.erb @@ -44,7 +44,7 @@ <% end %> <% content_for :header_tags do %> - <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %> + <%= auto_discovery_link_tag(:atom, _project_news_path(@project, :key => User.current.rss_key, :format => 'atom')) %> <%= stylesheet_link_tag 'scm' %> <% end %> diff --git a/app/views/repositories/entry.html.erb b/app/views/repositories/entry.html.erb index 37a5db961..b495dd4ae 100644 --- a/app/views/repositories/entry.html.erb +++ b/app/views/repositories/entry.html.erb @@ -9,7 +9,11 @@ <%= render :partial => 'link_to_functions' %> <% if Redmine::MimeType.is_type?('image', @path) %> - <%= render :partial => 'common/image', :locals => {:path => url_for(params.merge(:action => 'raw')), :alt => @path} %> + <%= render :partial => 'common/image', :locals => {:path => url_for(:action => 'raw', + :id => @project, + :repository_id => @repository.identifier_param, + :path => @path, + :rev => @rev), :alt => @path} %> <% elsif @content %> <%= render :partial => 'common/file', :locals => {:filename => @path, :content => @content} %> <% else %> diff --git a/app/views/repositories/revisions.html.erb b/app/views/repositories/revisions.html.erb index c0afb955a..fc22210da 100644 --- a/app/views/repositories/revisions.html.erb +++ b/app/views/repositories/revisions.html.erb @@ -23,8 +23,8 @@ <%= stylesheet_link_tag "scm" %> <%= auto_discovery_link_tag( :atom, - params.merge( - {:format => 'atom', :page => nil, :key => User.current.rss_key})) %> + :params => request.query_parameters.merge(:page => nil, :key => User.current.rss_key), + :format => 'atom') %> <% end %> <% other_formats_links do |f| %> diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index b89bbf9fe..d96a737ae 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -42,9 +42,10 @@ <% if @repository.supports_all_revisions? %> <% content_for :header_tags do %> <%= auto_discovery_link_tag( - :atom, params.merge( - {:format => 'atom', :action => 'revisions', - :id => @project, :page => nil, :key => User.current.rss_key})) %> + :atom, + :action => 'revisions', :id => @project, + :repository_id => @repository.identifier_param, + :key => User.current.rss_key) %> <% end %> <% other_formats_links do |f| %> -- 2.39.5