? filefield_codereview_0.patch
Index: field_file.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/filefield/field_file.inc,v
retrieving revision 1.17
diff -u -p -r1.17 field_file.inc
--- field_file.inc	27 Aug 2008 15:05:22 -0000	1.17
+++ field_file.inc	10 Oct 2008 00:57:57 -0000
@@ -342,10 +342,9 @@ function field_file_check_directory(&$di
       chmod($directory .'/.htaccess', 0664);
     }
     else {
-      $message =  "Security warning: Couldn't write .htaccess file. Please create a .htaccess file in your %directory directory which contains the following lines: <code>!htaccess</code>";
-      $repl =  array('%directory' => $directory, '!htaccess' => '<br />'. nl2br(check_plain($htaccess_lines)));
-      form_set_error($form_item, t($message, $repl));
-      watchdog('security', $message, $repl, WATCHDOG_ERROR);
+      $repl = array('%directory' => $directory, '!htaccess' => nl2br(check_plain($htaccess_lines)));
+      form_set_error($form_item, t("Security warning: Couldn't write .htaccess file. Please create a .htaccess file in your %directory directory which contains the following lines:<br /><code>!htaccess</code>", $repl));
+      watchdog('security', "Security warning: Couldn't write .htaccess file.  Please create a .htaccess file in your %directory directory which contains the following lines:<br /><code>!htaccess</code>", $repl, WATCHDOG_ERROR);
     }
   }
 
Index: filefield.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/filefield/filefield.install,v
retrieving revision 1.14
diff -u -p -r1.14 filefield.install
--- filefield.install	8 Oct 2008 20:19:37 -0000	1.14
+++ filefield.install	10 Oct 2008 00:57:58 -0000
@@ -237,8 +237,9 @@ function _filefield_update_6001_move_ope
  * Drop the list and description columns.
  */
 function _filefield_update_6001_drop_operation($field, &$context) {
+  $ret = array();
   $db_info = content_database_info($field);
   // TODO: Now that the data has been migrated we can drop the columns.
-  db_query('ALTER TABLE '. $db_info['table'] .' DROP COLUMN '.  $db_info['columns']['description']['column']);
+  db_drop_field($ret, $db_info['table'], $db_info['columns']['description']['column']);
   $context['finished'] = 1;
 }
Index: filefield_widget.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/filefield/filefield_widget.inc,v
retrieving revision 1.39
diff -u -p -r1.39 filefield_widget.inc
--- filefield_widget.inc	13 Sep 2008 00:43:27 -0000	1.39
+++ filefield_widget.inc	10 Oct 2008 00:57:58 -0000
@@ -357,7 +357,7 @@ function filefield_node_form_validate($f
   }
 }
 
-function filefield_node_form_submit($form, $form_state) {
+function filefield_node_form_submit($form, &$form_state) {
   // we ignore all but the save button here.
   if ($form_state['values']['op'] != t('Save')) {
     return;
