? .svn
? uploadpath-revisions-346977-1.patch
Index: uploadpath.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/uploadpath/uploadpath.module,v
retrieving revision 1.1.2.5.2.1
diff -u -p -r1.1.2.5.2.1 uploadpath.module
--- uploadpath.module	8 Sep 2008 08:20:02 -0000	1.1.2.5.2.1
+++ uploadpath.module	4 Mar 2009 13:33:30 -0000
@@ -33,10 +33,10 @@ function uploadpath_nodeapi(&$node, $op,
       if(isset($node->files) && user_access('upload files')) {
         foreach ($node->files as $key => $file) {
           // Only rewrite the path on new files to be saved
-          if ($file['new'] && !$file['remove']){
+          if (is_array($file) && $file['new'] && !$file['remove']){
             //get the token path pattern
             $pattern = variable_get('uploadpath_prefix_'.$node->type, false);
-            if(!$pattern){ 
+            if(!$pattern){
               //default pattern
               $pattern = variable_get('uploadpath_prefix', '[type]/[yyyy]/[mm]');
             }
@@ -70,7 +70,7 @@ function uploadpath_nodeapi(&$node, $op,
             // SECURITY NOTE:
             // Tokens include user supplied information and could provide an attack vector.
             // The current method of creating directories prevents the use of .. or other malicious
-            // paths, but future developers should keep this in mind when modifying the following code	
+            // paths, but future developers should keep this in mind when modifying the following code
             // Create the directory if it doesn't exist yet.
             $dirs = explode('/', dirname($file_name));
             $directory = file_directory_path();
@@ -81,7 +81,7 @@ function uploadpath_nodeapi(&$node, $op,
             //move file to new subfolder
             if (file_move($file['filepath'], $file_name, FILE_EXISTS_RENAME)) {
               //update node file array with new path, if needed
-              $node->files[$key]['filepath'] = $file_name; 
+              $node->files[$key]['filepath'] = $file_name;
               // update file record in database
               db_query("UPDATE {files} SET filepath = '%s' WHERE fid = %d", $file['filepath'], $file['fid']);
             }
