diff --git a/includes/filetransfer/filetransfer.inc b/includes/filetransfer/filetransfer.inc index 1afaa9e0fb2bd77b25be812cd786cba8cbf5c99c..db06436128e055862b9901479d19ea4953d9b1a7 100644 --- a/includes/filetransfer/filetransfer.inc +++ b/includes/filetransfer/filetransfer.inc @@ -208,7 +208,7 @@ protected function copyDirectoryJailed($source, $destination) { $destination = $destination . '/' . basename($source); } $this->createDirectory($destination); - foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source), RecursiveIteratorIterator::SELF_FIRST) as $filename => $file) { + foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::SELF_FIRST) as $filename => $file) { $relative_path = substr($filename, strlen($source)); if ($file->isDir()) { $this->createDirectory($destination . $relative_path); diff --git a/includes/filetransfer/local.inc b/includes/filetransfer/local.inc index 8cad200b1ca7bb2d1ee31fc7cfe83931b70b5e0f..7734b2db8e0f85d4a27b5dae3e9f16621b70e20c 100644 --- a/includes/filetransfer/local.inc +++ b/includes/filetransfer/local.inc @@ -31,7 +31,7 @@ protected function removeDirectoryJailed($directory) { // Programmer error assertion, not something we expect users to see. throw new FileTransferException('removeDirectoryJailed() called with a path (%directory) that is not a directory.', NULL, array('%directory' => $directory)); } - foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory), RecursiveIteratorIterator::CHILD_FIRST) as $filename => $file) { + foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST) as $filename => $file) { if ($file->isDir()) { if (@!drupal_rmdir($filename)) { throw new FileTransferException('Cannot remove directory %directory.', NULL, array('%directory' => $filename)); @@ -64,7 +64,7 @@ public function isFile($path) { public function chmodJailed($path, $mode, $recursive) { if ($recursive && is_dir($path)) { - foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST) as $filename => $file) { + foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::SELF_FIRST) as $filename => $file) { if (@!chmod($filename, $mode)) { throw new FileTransferException('Cannot chmod %path.', NULL, array('%path' => $filename)); }