Index: imagefield.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imagefield/imagefield.module,v
retrieving revision 1.106
diff -u -r1.106 imagefield.module
--- imagefield.module	28 Apr 2010 20:36:36 -0000	1.106
+++ imagefield.module	28 Apr 2010 21:05:09 -0000
@@ -336,7 +336,14 @@
     $query_string = $query_character . $file['timestamp'];
   }
 
-  $url = file_create_url($file['filepath']) . $query_string;
+  // Encode the parts of the path.
+  $parts = explode('/', $file['filepath']);
+  foreach ($parts as $n => $part) {
+    $parts[$n] = rawurlencode($part);
+  }
+  $path = implode('/', $parts);
+
+  $url = file_create_url($path) . $query_string;
   $attributes['src'] = $url;
   $attributes = drupal_attributes($attributes);
   return '<img '. $attributes .' />';
@@ -360,6 +367,13 @@
   }
   $thumb_path = imagefield_file_admin_thumb_path($item);
 
+  // Encode the parts of the path.
+  $parts = explode('/', $thumb_path);
+  foreach ($parts as $n => $part) {
+    $parts[$n] = rawurlencode($part);
+  }
+  $thumb_path = implode('/', $parts);
+
   // Add a timestamp to the URL to ensure it is immediately updated after editing.
   $query_character = (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PRIVATE && variable_get('clean_url', '0') == '0') ? '&' : '?';
   $query_string = $query_character . time();
