Index: components/file.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/webform/components/file.inc,v retrieving revision 1.24 diff -u -r1.24 file.inc --- components/file.inc 28 Sep 2010 22:43:49 -0000 1.24 +++ components/file.inc 17 Oct 2010 01:01:18 -0000 @@ -130,9 +130,9 @@ '#type' => 'textfield', '#title' => t('Upload Directory'), '#default_value' => $component['extra']['savelocation'], - '#description' => '
' . t('Webform uploads are always saved in the site files directory. You may optionally specify a subfolder to store your files.') . '
', + '#description' => t('Webform uploads are always saved in the site files directory. You may optionally specify a subfolder to store your files.'), '#weight' => 3, - '#field_prefix' => file_directory_path() . '/webform/', + '#field_prefix' => file_stream_wrapper_get_instance_by_scheme(file_default_scheme())->getDirectoryPath() . '/webform/', '#element_validate' => array('_webform_edit_file_check_directory'), '#after_build' => array('_webform_edit_file_check_directory'), ); Index: webform.install =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/webform/webform.install,v retrieving revision 1.55 diff -u -r1.55 webform.install --- webform.install 4 Sep 2010 18:12:15 -0000 1.55 +++ webform.install 17 Oct 2010 01:01:18 -0000 @@ -387,7 +387,7 @@ // Delete uploaded files. $filepath = file_build_uri('webform'); - _webform_recursive_delete($filepath); + file_unmanaged_delete_recursive($filepath); } /** @@ -417,27 +417,3 @@ db_add_field('webform_emails', 'attachments', array('type' => 'int', 'size' => 'tiny', 'unsigned' => TRUE, 'default' => 0, 'not null' => TRUE)); } } - -/** - * Recursively delete all files and folders in the specified filepath, then - * delete the containing folder. - * - * Note that this only deletes visible files with write permission - * - * @param string $path - * A filepath relative to file_directory_path - */ -function _webform_recursive_delete($path) { - if ($path && is_dir($path)) { - $listing = $path . '/*'; - foreach (glob($listing) as $file) { - if (is_file($file) === TRUE) { - @unlink($file); - } - elseif (is_dir($file) === TRUE) { - _webform_recursive_delete($file); - } - } - @rmdir($path); - } -}