function make_safe_path

8.0.x make.utilities.inc make_safe_path($path)
6.x make.utilities.inc make_safe_path($path)
7.x make.utilities.inc make_safe_path($path)
5.x make.utilities.inc make_safe_path($path)
master make.utilities.inc make_safe_path($path)

Checks an attribute's path to ensure it's not maliciously crafted.

Parameters

string $path: The path to check.

1 call to make_safe_path()
make_validate_info_file in commands/make/make.utilities.inc
Validate the make file.

File

commands/make/make.utilities.inc, line 446
General utility functions for Drush Make.

Code

function make_safe_path($path) {
  return !preg_match("+^/|^\.\.|/\.\./+", $path);
}