summaryrefslogtreecommitdiffstats
path: root/app/helpers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-04-03 22:29:58 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-04-03 22:29:58 +0000
commit8d4aa6f9ade613f831ff2043713ad062293babfd (patch)
tree451a9b172ebba9a81cbd1164733f4ebff2a1b98b /app/helpers
parent14a2b7e9b5765de3145c63e22affee06f20e33fc (diff)
downloadredmine-8d4aa6f9ade613f831ff2043713ad062293babfd.tar.gz
redmine-8d4aa6f9ade613f831ff2043713ad062293babfd.zip
Fixed: single file 'View difference' links do not work because of duplicate slashes in url.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1325 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/repositories_helper.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb
index 31daf1bd8..22bdec9df 100644
--- a/app/helpers/repositories_helper.rb
+++ b/app/helpers/repositories_helper.rb
@@ -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)