Check symlink outside site_source without Pathutil (#9015)
Merge pull request 9015
This commit is contained in:
parent
19868d5602
commit
9c7972dc38
|
@ -86,14 +86,10 @@ module Jekyll
|
||||||
end
|
end
|
||||||
|
|
||||||
# --
|
# --
|
||||||
# NOTE: Pathutil#in_path? gets the realpath.
|
# Check if given path is outside of current site's configured source directory.
|
||||||
# @param [<Anything>] entry the entry you want to validate.
|
|
||||||
# Check if a path is outside of our given root.
|
|
||||||
# --
|
# --
|
||||||
def symlink_outside_site_source?(entry)
|
def symlink_outside_site_source?(entry)
|
||||||
!Pathutil.new(entry).in_path?(
|
!File.realpath(entry).start_with?(site.in_source_dir)
|
||||||
site.in_source_dir
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Check if an entry matches a specific pattern.
|
# Check if an entry matches a specific pattern.
|
||||||
|
|
Loading…
Reference in New Issue