Index: imagefield.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imagefield/imagefield.module,v
retrieving revision 1.83
diff -u -r1.83 imagefield.module
--- imagefield.module	19 Mar 2009 03:36:52 -0000	1.83
+++ imagefield.module	20 Mar 2009 01:49:04 -0000
@@ -107,15 +107,15 @@
  */
 function imagefield_file_download($filepath) {
   // Return headers for admin thumbnails if private files are enabled.
-  if (strpos($filepath, '.thumb.')) {
-    $original_path = str_replace('.thumb', '', $filepath);
+  if (strpos($filepath, 'imagefield_thumbs') !== FALSE) {
+    $original_path = str_replace('imagefield_thumbs/', '', $filepath);
     $original_full_path = file_create_path($original_path);
     $thumb_full_path = file_create_path($filepath);
 
     // Allow access to temporary thumbnails, since they're not yet associated
     // with a node. If not temporary, check access on the original file.
-    $temporary = db_result(db_query("SELECT status FROM {files} WHERE filepath = '%s'", $original_full_path));
-    $access = ($temporary == 0 || module_invoke_all('file_download', $original_path));
+    $status = db_result(db_query("SELECT status FROM {files} WHERE filepath = '%s'", $original_full_path));
+    $access = ($status == 0 || module_invoke_all('file_download', $original_path));
     if ($access && $info = getimagesize($thumb_full_path)) {
       return array(
         'Content-Type: ' . $info['mime'],
