Method: FSDB::PathUtilities#validate

Defined in:
lib/fsdb/util.rb

#validate(path) ⇒ Object

Raises InvalidPathError if canonical(path) still has embedded ‘..’, which means the path would refer to a file not below the database directory. Returns the canonical path, otherwise.



41
42
43
44
45
46
47
# File 'lib/fsdb/util.rb', line 41

def validate(path)
  path = canonical(path)
  unless valid?(path)
    raise InvalidPathError, "Path #{path} is outside the database."
  end
  path
end