diff options
Diffstat (limited to 'modules/system/system.api.php')
-rw-r--r-- | modules/system/system.api.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/system/system.api.php b/modules/system/system.api.php index e14c45368..5a0b3f648 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -1199,8 +1199,8 @@ function hook_file_move($file, $source) { */ function hook_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); } |