Expand from root rather than current working directory
This commit is contained in:
parent
3dd165b494
commit
8a1de58286
|
@ -115,8 +115,9 @@ module Zip
|
||||||
def name_safe?
|
def name_safe?
|
||||||
cleanpath = Pathname.new(@name).cleanpath
|
cleanpath = Pathname.new(@name).cleanpath
|
||||||
return false unless cleanpath.relative?
|
return false unless cleanpath.relative?
|
||||||
naive_expanded_path = ::File.join(Dir.pwd, cleanpath.to_s)
|
root = ::File::SEPARATOR
|
||||||
cleanpath.expand_path.to_s == naive_expanded_path
|
naive_expanded_path = ::File.join(root, cleanpath.to_s)
|
||||||
|
cleanpath.expand_path(root).to_s == naive_expanded_path
|
||||||
end
|
end
|
||||||
|
|
||||||
def local_entry_offset #:nodoc:all
|
def local_entry_offset #:nodoc:all
|
||||||
|
|
Loading…
Reference in New Issue