diff options
Diffstat (limited to 'modules/user')
-rw-r--r-- | modules/user/user.module | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/user/user.module b/modules/user/user.module index 7057a0b94..5f6264a3f 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -773,10 +773,11 @@ function user_file_download($uri) { */ function user_file_references($file) { // Determine if the file is used by this module. - $count = (int) db_query('SELECT COUNT(1) FROM {users} WHERE picture = :fid', array(':fid' => $file->fid))->fetchField(); - if ($count) { + $file_used = (bool) db_query_range('SELECT 1 FROM {users} WHERE picture = :fid', 0, 1, array(':fid' => $file->fid))->fetchField(); + if ($file_used) { // Return the name of the module and how many references it has to the file. - return array('user' => $count); + // If file is still used then 1 is enough to indicate this. + return array('user' => 1); } } |