Index: imagefield.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imagefield/imagefield.module,v
retrieving revision 1.113
diff -u -r1.113 imagefield.module
--- imagefield.module	8 Dec 2010 04:57:07 -0000	1.113
+++ imagefield.module	8 Dec 2010 20:25:11 -0000
@@ -345,8 +345,14 @@
     $query_string = $query_character . $file['timestamp'];
   }
 
+  // Strip off the file directory path if present.
+  $path = $file['filepath'];
+  if (strpos($path, file_directory_path() .'/') === 0) {
+    $path = trim(substr($path, strlen(file_directory_path())), '\\/');
+  }
+
   // Encode the parts of the path.
-  $parts = explode('/', $file['filepath']);
+  $parts = explode('/', $path);
   foreach ($parts as $n => $part) {
     $parts[$n] = rawurlencode($part);
   }
@@ -376,6 +382,12 @@
   }
   $thumb_path = imagefield_file_admin_thumb_path($item);
 
+  // Strip off the file directory path if present.
+  $thumb_path = $file['filepath'];
+  if (strpos($thumb_path, file_directory_path() .'/') === 0) {
+    $thumb_path = trim(substr($thumb_path, strlen(file_directory_path())), '\\/');
+  }
+
   // Encode the parts of the path.
   $parts = explode('/', $thumb_path);
   foreach ($parts as $n => $part) {
