diff options
author | Florian Pritz <bluewind@server-speed.net> | 2011-01-28 22:51:06 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@server-speed.net> | 2011-01-28 22:58:52 +0100 |
commit | ce2b69675075444c9e40b72bcdd42ab7edbbe633 (patch) | |
tree | 2932f13b0db14fe53dc0622d888318db638a017f /system/helpers/download_helper.php | |
parent | b6b8a6587c399bfd89e13e92ce04ee8486688e6e (diff) |
update to CI 2.0
Signed-off-by: Florian Pritz <bluewind@server-speed.net>
Diffstat (limited to 'system/helpers/download_helper.php')
-rwxr-xr-x[-rw-r--r--] | system/helpers/download_helper.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index 638ebaa88..6cecd0d11 100644..100755 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -2,11 +2,11 @@ /** * CodeIgniter * - * An open source application development framework for PHP 4.3.2 or newer + * An open source application development framework for PHP 5.1.6 or newer * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 @@ -36,7 +36,7 @@ * @param string filename * @param mixed the data to be downloaded * @return void - */ + */ if ( ! function_exists('force_download')) { function force_download($filename = '', $data = '') @@ -52,14 +52,14 @@ if ( ! function_exists('force_download')) { return FALSE; } - + // Grab the file extension $x = explode('.', $filename); $extension = end($x); // Load the mime types @include(APPPATH.'config/mimes'.EXT); - + // Set a default mime if we can't find it if ( ! isset($mimes[$extension])) { @@ -69,9 +69,9 @@ if ( ! function_exists('force_download')) { $mime = (is_array($mimes[$extension])) ? $mimes[$extension][0] : $mimes[$extension]; } - + // Generate the server headers - if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) + if (strpos($_SERVER['HTTP_USER_AGENT'], "MSIE") !== FALSE) { header('Content-Type: "'.$mime.'"'); header('Content-Disposition: attachment; filename="'.$filename.'"'); @@ -90,7 +90,7 @@ if ( ! function_exists('force_download')) header('Pragma: no-cache'); header("Content-Length: ".strlen($data)); } - + exit($data); } } |