From 5546648d9092501b8c796a9a139cab6f092baee8 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 1 Aug 2011 20:25:52 -0400 Subject: - Patch #1221214 by chx: file_download() returns 404 instead of 403. --- includes/file.inc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'includes/file.inc') 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(); } -- cgit v1.2.3