]> source.dussan.org Git - redmine.git/commitdiff
Fixed: single file 'View difference' links do not work because of duplicate slashes...
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 3 Apr 2008 22:29:58 +0000 (22:29 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 3 Apr 2008 22:29:58 +0000 (22:29 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1325 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/repositories_helper.rb
app/views/repositories/revision.rhtml

index 31daf1bd86a1d5ba4cd56ba00bed81f38b3920fc..22bdec9df986d30a240f3944de90e98fa4f9e477 100644 (file)
@@ -58,8 +58,11 @@ module RepositoriesHelper
   end
   
   def with_leading_slash(path)
-    path ||= ''
-    path.starts_with?('/') ? path : "/#{path}"
+    path.to_s.starts_with?('/') ? path : "/#{path}"
+  end
+  
+  def without_leading_slash(path)
+    path.gsub(%r{^/+}, '')
   end
 
   def subversion_field_tags(form, repository)
index 5a7ef1fd534552b8e5c9d38b7ba9bf0f5642f4d1..f1e176669f25af159514bec426eb5c5b3c6b5cb9 100644 (file)
@@ -49,7 +49,7 @@
 <td><div class="square action_<%= change.action %>"></div> <%= change.path %> <%= "(#{change.revision})" unless change.revision.blank?  %></td>
 <td align="right">
 <% if change.action == "M" %>
-<%= link_to l(:label_view_diff), :action => 'diff', :id => @project, :path => change.path, :rev => @changeset.revision %>
+<%= link_to l(:label_view_diff), :action => 'diff', :id => @project, :path => without_leading_slash(change.path), :rev => @changeset.revision %>
 <% end %>
 </td>
 </tr>