Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Replace outdated "URI.encode"

Henriette Darge527e84373e98
diff --git a/app/views/repositories/diff.html.erb b/app/views/repositories/diff.html.erb
index a42963a8302..d59210fed06 100644
--- a/app/views/repositories/diff.html.erb
+++ b/app/views/repositories/diff.html.erb
@@ -52,8 +52,8 @@ See COPYRIGHT and LICENSE files for more details.
<% unidiff_link.gsub!('?', '&amp;') %>
<% end %>
- <% wrong_url = CGI::escapeHTML(URI.encode(with_leading_slash(@path))).concat('.diff') %>
- <% good_url = '.diff'.concat('?repo_path=', URI.encode(without_leading_slash(@path)).gsub('&', '%26')) %>
+ <% wrong_url = CGI::escapeHTML(CGI.escape(with_leading_slash(@path))).concat('.diff') %>
+ <% good_url = '.diff'.concat('?repo_path=', CGI.escape(without_leading_slash(@path)).gsub('&', '%26')) %>
<% unidiff_link.gsub!(wrong_url, good_url) %>
<%= unidiff_link.html_safe %>
<% end %>