Closed (fixed)
Project:
ImageField
Version:
6.x-3.2
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Mar 2010 at 13:37 UTC
Updated:
17 Jun 2010 at 00:49 UTC
Notice bug fix:
diff -r sites/all/modules/imagefield/imagefield_file.inc
--- a/sites/all/modules/imagefield/imagefield_file.inc
+++ b/sites/all/modules/imagefield/imagefield_file.inc
@@ -29,7 +29,13 @@
*/
function imagefield_file_is_image($file) {
$file = (object)$file;
- return in_array($file->filemime, array('image/jpg', 'image/pjpeg', 'image/jpeg', 'image/png', 'image/gif'));
+ if (isset($file->filemime)) {
+ $result = in_array($file->filemime, array('image/jpg', 'image/pjpeg', 'image/jpeg', 'image/png', 'image/gif'));
+ }
+ else {
+ $result = FALSE;
+ }
+ return $result;
}
/**
Comments
Comment #1
quicksketchCould you describe a situation in which this notice appears? Clearly it's going to deny access in the situation that a notice would occur, but I'm not sure what would cause this to arise.
Comment #2
quicksketchClosing after lack of response. Please reopen if you can provide steps to reproduce the notice.