diff options
Diffstat (limited to 'modules/upload/upload.module')
-rw-r--r-- | modules/upload/upload.module | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/upload/upload.module b/modules/upload/upload.module index 7c288dde4..513cfecee 100644 --- a/modules/upload/upload.module +++ b/modules/upload/upload.module @@ -282,8 +282,8 @@ function upload_file_load($files) { */ function upload_file_references($file) { // If upload.module is still using a file, do not let other modules delete it. - $count = db_query('SELECT COUNT(*) FROM {upload} WHERE fid = :fid', array(':fid' => $file->fid))->fetchField(); - if ($count) { + $file_used = (bool) db_query_range('SELECT 1 FROM {upload} WHERE fid = :fid', array(':fid' => $file->fid), 0, 1)->fetchField(); + if ($file_used) { // Return the name of the module and how many references it has to the file. return array('upload' => $count); } |