Defect #7505
closedSubversion: Repository URL with space not handled correctly
Description
To avoid issues with any special characters in URL I use Tortoise svn and it's " copy url link " option while browing repository. So Redmine gets nice clean proper URLs:
https://server/projects/Project%20Name
However, new Redmine now is munging clean URLs. For example the above URL gets parsed as:
https://server/projects/Project%2520Name
as far as I can guess, the URL is meant to be escaped, however lib\redmine\scm\adapters\subversion_adapter.rb is doing too much of replacing :
def target(path = '')
base = path.match(/^\//) ? root_url : url
uri = "#{base}/#{path}"
uri = URI.escape(URI.escape(uri), '[]')
shell_quote(uri.gsub(/[?<>\*]/, ''))
end
This code is escaping too much. If URL is properly entered (and it should be) then no need to escape it again.
This is a regression from 0.9 series that worked ok with URLs.
Updated by Toshi MARUYAMA over 15 years ago
- Subject changed from Repository URL not handled correctly to Subversion: Repository URL not handled correctly
Updated by Toshi MARUYAMA over 15 years ago
- Subject changed from Subversion: Repository URL not handled correctly to Subversion: Repository URL with space not handled correctly
Updated by Toshi MARUYAMA about 12 years ago
- Related to Defect #17882: Subversion: French character filename causes error 404 added
Updated by Go MAEDA almost 10 years ago
- Status changed from New to Closed
No problem in the current trunk (r16171).

Updated by Toshi MARUYAMA about 9 years ago
- Related to Defect #27043: Subversion repositories with spaces in the root URL cause broken file and diff links on the revision page added
Updated by Abe Tomoaki 3 days ago
I ran into the same double encoding in target.
root_url is the result of svn info, so it's already encoded (e.g. file:///svn/my%20repo).
If a path that starts with / is given, target uses root_url and encodes it again. So we get %2520 and the svn command fails.
It seems that Redmine itself doesn't pass a path that starts with / to target.
So this problem doesn't appear in Redmine itself. But it happens when a plugin passes such a path.