diff options
author | Dries Buytaert <dries@buytaert.net> | 2011-08-01 20:25:52 -0400 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2011-08-01 20:25:52 -0400 |
commit | 5546648d9092501b8c796a9a139cab6f092baee8 (patch) | |
tree | 94b9535dc188bd143b906645260a9fee983716b7 /includes/file.inc | |
parent | f60942fed0ff266aa2456ba4e5ecc2ba3e64bc3d (diff) | |
download | brdo-5546648d9092501b8c796a9a139cab6f092baee8.tar.gz brdo-5546648d9092501b8c796a9a139cab6f092baee8.tar.bz2 |
- Patch #1221214 by chx: file_download() returns 404 instead of 403.
Diffstat (limited to 'includes/file.inc')
-rw-r--r-- | includes/file.inc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/includes/file.inc b/includes/file.inc index b01271216..e0da21660 100644 --- a/includes/file.inc +++ b/includes/file.inc @@ -1902,10 +1902,11 @@ function file_transfer($uri, $headers) { * Menu handler for private file transfers. * * Call modules that implement hook_file_download() to find out if a file is - * accessible and what headers it should be transferred with. If a module - * returns -1 drupal_access_denied() will be returned. If one or more modules - * returned headers the download will start with the returned headers. If no - * modules respond drupal_not_found() will be returned. + * accessible and what headers it should be transferred with. If one or more + * modules returned headers the download will start with the returned headers. + * If a module returns -1 drupal_access_denied() will be returned. If the file + * exists but no modules responded drupal_access_denied() will be returned. + * If the file does not exist drupal_not_found() will be returned. * * @see hook_file_download() */ @@ -1934,6 +1935,7 @@ function file_download() { if (count($headers)) { file_transfer($uri, $headers); } + return drupal_access_denied(); } return drupal_not_found(); } |