From 9a7fbeb028b50e8ebfa932856f47140c57dcf74d Mon Sep 17 00:00:00 2001 From: Nick Booher Date: Fri, 4 Aug 2017 08:29:43 -0500 Subject: [PATCH] Validate directory path --- includes/filesystem.inc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/includes/filesystem.inc b/includes/filesystem.inc index abe9b26a28..37428cdb83 100644 --- a/includes/filesystem.inc +++ b/includes/filesystem.inc @@ -318,6 +318,12 @@ function drush_move_dir($src, $dest, $overwrite = FALSE) { * halted if the required directory cannot be created. */ function drush_mkdir($path, $required = TRUE) { + if (!is_string($path) || $path === '') { + if (!$required) { + return FALSE; + } + return drush_set_error('DRUSH_INVALID_DIRECTORY_PATH', dt('Unable to create directory. Invalid path provided.')); + } if (!is_dir($path)) { if (drush_mkdir(dirname($path))) { if (@mkdir($path)) {