Commit 0f3761b9 authored by webchick's avatar webchick

#515280 by drewish: Allow file_create_directory() to create recursively, taking advantage of PHP 5.

parent 6dee32f9
......@@ -156,7 +156,9 @@ function file_check_directory(&$directory, $mode = 0, $form_item = NULL) {
// Check if directory exists.
if (!is_dir($directory)) {
if (($mode & FILE_CREATE_DIRECTORY) && @mkdir($directory)) {
// Let mkdir() recursively create directories and use the default directory
// permissions.
if (($mode & FILE_CREATE_DIRECTORY) && @mkdir($directory, variable_get('file_chmod_directory', 0775), TRUE)) {
drupal_chmod($directory);
}
else {
......
......@@ -672,7 +672,7 @@ class FileDirectoryTest extends FileTestCase {
*/
function testFileCheckDirectory() {
// A directory to operate on.
$directory = file_directory_path() . '/' . $this->randomName();
$directory = file_directory_path() . '/' . $this->randomName() . '/' . $this->randomName();
$this->assertFalse(is_dir($directory), t('Directory does not exist prior to testing.'));
// Non-existent directory.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment