diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-10-18 01:00:39 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-10-18 01:00:39 +0000 |
commit | 63c15e549005f5d49dfb4cc6ff3e0c6eb5b7f11d (patch) | |
tree | cb5d909744ce5beb5c6137a1fea1a0b93c2f97f3 /modules/file | |
parent | 468d201ce1e6908cfb565860a888bdae648010bf (diff) | |
download | brdo-63c15e549005f5d49dfb4cc6ff3e0c6eb5b7f11d.tar.gz brdo-63c15e549005f5d49dfb4cc6ff3e0c6eb5b7f11d.tar.bz2 |
- Patch #943112 by ksenzee: file_file_download() should delegate header checks to a separate function.
Diffstat (limited to 'modules/file')
-rw-r--r-- | modules/file/file.module | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/modules/file/file.module b/modules/file/file.module index 69130b2f8..08b383555 100644 --- a/modules/file/file.module +++ b/modules/file/file.module @@ -216,24 +216,8 @@ function file_file_download($uri, $field_type = 'file') { } // Access is granted. - $name = mime_header_encode($file->filename); - $type = mime_header_encode($file->filemime); - // Serve images, text, and flash content for display rather than download. - $inline_types = variable_get('file_inline_types', array('^text/', '^image/', 'flash$')); - $disposition = 'attachment'; - foreach ($inline_types as $inline_type) { - // Exclamation marks are used as delimiters to avoid escaping slashes. - if (preg_match('!' . $inline_type . '!', $file->filemime)) { - $disposition = 'inline'; - } - } - - return array( - 'Content-Type' => $type . '; name="' . $name . '"', - 'Content-Length' => $file->filesize, - 'Content-Disposition' => $disposition . '; filename="' . $name . '"', - 'Cache-Control' => 'private', - ); + $headers = file_get_content_headers($file); + return $headers; } /** |