mirror of
https://github.com/jekyll/jekyll.git
synced 2026-01-30 09:18:11 -05:00
Use Jekyll.sanitized_path more.
This commit is contained in:
@@ -43,7 +43,7 @@ module Jekyll
|
||||
# Returns nothing.
|
||||
def read_yaml(base, name, opts = {})
|
||||
begin
|
||||
self.content = File.read(File.join(base, name),
|
||||
self.content = File.read(Jekyll.sanitized_path(base, name),
|
||||
merged_file_read_opts(opts))
|
||||
if content =~ /\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)/m
|
||||
self.content = $POSTMATCH
|
||||
|
||||
@@ -195,7 +195,7 @@ module Jekyll
|
||||
#
|
||||
# Returns nothing
|
||||
def read_data(dir)
|
||||
base = File.join(source, dir)
|
||||
base = Jekyll.sanitized_path(source, dir)
|
||||
read_data_to(base, self.data)
|
||||
end
|
||||
|
||||
@@ -214,7 +214,7 @@ module Jekyll
|
||||
end
|
||||
|
||||
entries.each do |entry|
|
||||
path = File.join(dir, entry)
|
||||
path = Jekyll.sanitized_path(dir, entry)
|
||||
next if File.symlink?(path) && safe
|
||||
|
||||
key = sanitize_filename(File.basename(entry, '.*'))
|
||||
|
||||
Reference in New Issue
Block a user