summaryrefslogtreecommitdiff
path: root/modules/file
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-09-11 05:07:22 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-09-11 05:07:22 +0000
commitf096a70e67a75e30dafd3e15448b579bfb1909c2 (patch)
treefa74a51731b788768f625ec6e3fa97e83491b448 /modules/file
parent8ce58d16744e44b1c166e820b88662197eaf6982 (diff)
downloadbrdo-f096a70e67a75e30dafd3e15448b579bfb1909c2.tar.gz
brdo-f096a70e67a75e30dafd3e15448b579bfb1909c2.tar.bz2
#898036 by Berdir: Fixed Private images broken. (with tests)
Diffstat (limited to 'modules/file')
-rw-r--r--modules/file/file.module8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/file/file.module b/modules/file/file.module
index a79c8f542..1388f179b 100644
--- a/modules/file/file.module
+++ b/modules/file/file.module
@@ -138,9 +138,15 @@ function file_file_download($uri, $field_type = 'file') {
return;
}
- // Find out which (if any) file fields contain this file.
+ // Find out which (if any) fields of this type contain the file.
$references = file_get_file_references($file, NULL, FIELD_LOAD_REVISION, $field_type);
+ // If there are no references, stop processing, to avoid returning headers
+ // for files controlled by other modules.
+ if (empty($references)) {
+ return;
+ }
+
// Default to allow access.
$denied = FALSE;
// Loop through all references of this file. If a reference explicitly allows