Skip to content
This repository was archived by the owner on Aug 19, 2021. It is now read-only.

Commit fb3910c

Browse files
committed
Quote ' in attachment filename also must encoded to hex string.
Also skip encoded slashes in the path.
1 parent f031e21 commit fb3910c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

README

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Transform texts to textile format:
7171
Components: 23/23
7272
Milestones: 35/35
7373
Tickets: 2203/2203
74-
Ticket files: 262/263
74+
Ticket files: 263/263
7575
Custom values: 4200/4200
76-
Wiki edits: 4380/4380
77-
Wiki files: 36/75
76+
Wiki edits: 4379/4379
77+
Wiki files: 75/75

migrate_from_trac.rake

+2-2
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ namespace :redmine do
153153
private
154154
def trac_fullpath
155155
attachment_type = read_attribute(:type)
156-
trac_file = filename.gsub( /[^a-zA-Z0-9\-_\.!~*']/n ) {|x| sprintf('%%%02X', x[0]) }
157-
trac_dir = id.gsub( /[^a-zA-Z0-9\-_\.!~*']/n ) {|x| sprintf('%%%02X', x[0]) }
156+
trac_file = filename.gsub( /[^a-zA-Z0-9\-_\.!~*]/n ) {|x| sprintf('%%%02X', x[0]) }
157+
trac_dir = id.gsub( /[^a-zA-Z0-9\-_\.!~*\\\/]/n ) {|x| sprintf('%%%02X', x[0]) }
158158
"#{TracMigrate.trac_attachments_directory}/#{attachment_type}/#{trac_dir}/#{trac_file}"
159159
end
160160
end

0 commit comments

Comments
 (0)