class Asciidoctor::AbstractNode
def normalize_system_path target, start = nil, jail = nil, opts = {}
parent references resolved and self references removed. If a jail is provided,
Returns the [String] path resolved from the start and target paths, with any
outside the jail.
raises a SecurityError if a jail is specified and the resolved path is
* :target_name is used in messages to refer to the path being resolved
automatically recover when an illegal path is encountered
* :recover is used to control whether the processor should
opts - an optional Hash of options to control processing (default: {}):
jail - the String jail path to confine the resolved path
start - the String start (i.e., parent) path
target - the String target path
by default).
safe level is set to SafeMode::SAFE or greater (a condition which is true
file, stored in the base_dir instance variable on Document) if the document
path outside of the jail (which defaults to the directory of the source
The most important functionality in this method is to prevent resolving a
See {PathResolver#system_path} for details.
using the PathResolver.
Public: Resolve and normalize a secure path from the target and start paths
def normalize_system_path target, start = nil, jail = nil, opts = {} if (doc = @document).safe < SafeMode::SAFE if start start = ::File.join doc.base_dir, start unless doc.path_resolver.root? start else start = doc.base_dir end else start = doc.base_dir unless start jail = doc.base_dir unless jail end doc.path_resolver.system_path target, start, jail, opts end