Use Jekyll.sanitized_path when adding static files to Collections.

h/t @benbalter https://github.com/jekyll/jekyll/pull/2737#discussion_r16713423
Not sure if the previous code can be exploited, but being super safe is never a bad thing.
This commit is contained in:
Parker Moore 2014-08-28 22:42:16 -07:00
parent 7de681ef58
commit b5dbc36975
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ module Jekyll
doc.read
docs << doc
else
relative_dir = File.join(relative_directory, File.dirname(file_path)).chomp("/.")
relative_dir = Jekyll.sanitized_path(relative_directory, File.dirname(file_path)).chomp("/.")
files << StaticFile.new(site, site.source, relative_dir, File.basename(full_path), self)
end
end