From b8afd045b9ed165bdae0d18b3e6f7483a4566e1c Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 2 Oct 2006 06:46:29 +0000 Subject: --- system/helpers/download_helper.php | 96 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 system/helpers/download_helper.php (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php new file mode 100644 index 000000000..8d9fee478 --- /dev/null +++ b/system/helpers/download_helper.php @@ -0,0 +1,96 @@ + \ No newline at end of file -- cgit v1.2.3-24-g4f1b From e334c472fb4be44feec3a73402fc4a2b062cbfc0 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 21 Oct 2006 19:44:22 +0000 Subject: --- system/helpers/download_helper.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index 8d9fee478..dbedd8722 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -7,12 +7,12 @@ * @package CodeIgniter * @author Rick Ellis * @copyright Copyright (c) 2006, pMachine, Inc. - * @license http://www.codeignitor.com/user_guide/license.html + * @license http://www.codeignitor.com/user_guide/license.html * @link http://www.codeigniter.com * @since Version 1.0 * @filesource */ - + // ------------------------------------------------------------------------ /** @@ -78,8 +78,8 @@ function force_download($filename = '', $data = '') header("Content-Transfer-Encoding: binary"); header('Pragma: public'); header("Content-Length: ".strlen($data)); - } - else + } + else { header('Content-Type: "'.$mime.'"'); header('Content-Disposition: attachment; filename="'.$filename.'"'); -- cgit v1.2.3-24-g4f1b From dbbe40862c895296a9e3d9e184ff2da3788800d4 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 13 Feb 2007 23:46:23 +0000 Subject: changed Content-Disposition: from "inline" to "attachment" for MSIE in force_download() --- system/helpers/download_helper.php | 190 ++++++++++++++++++------------------- 1 file changed, 95 insertions(+), 95 deletions(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index dbedd8722..34cc152cc 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -1,96 +1,96 @@ - \ No newline at end of file -- cgit v1.2.3-24-g4f1b From d2df9bc7cc9d4b3e53818470c5d0977c9a36677c Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 15 Apr 2007 17:41:17 +0000 Subject: update pMachine to EllisLab update copyright year update Code Igniter to CodeIgniter --- system/helpers/download_helper.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index 34cc152cc..c9d81f692 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -1,12 +1,12 @@ Date: Thu, 4 Oct 2007 19:29:59 +0000 Subject: Fixed a typo in the docblock comments that had CodeIgniter spelled CodeIgnitor. --- system/helpers/download_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index c9d81f692..257233481 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -7,7 +7,7 @@ * @package CodeIgniter * @author Rick Ellis * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeignitor.com/user_guide/license.html + * @license http://www.codeigniter.com/user_guide/license.html * @link http://www.codeigniter.com * @since Version 1.0 * @filesource -- cgit v1.2.3-24-g4f1b From 3d879d529107c0c9d3f1e6b894d9ed17b6e6c54f Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 18 Jan 2008 19:41:32 +0000 Subject: ExpressionEngine Dev Team in credit --- system/helpers/download_helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index 257233481..ece22d9a9 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -5,7 +5,7 @@ * An open source application development framework for PHP 4.3.2 or newer * * @package CodeIgniter - * @author Rick Ellis + * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. * @license http://www.codeigniter.com/user_guide/license.html * @link http://www.codeigniter.com @@ -21,7 +21,7 @@ * @package CodeIgniter * @subpackage Helpers * @category Helpers - * @author Rick Ellis + * @author ExpressionEngine Dev Team * @link http://www.codeigniter.com/user_guide/helpers/download_helper.html */ -- cgit v1.2.3-24-g4f1b From 7a9193afa6d890a91eb3528fa0e62df799b07ed6 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Mon, 21 Jan 2008 18:39:20 +0000 Subject: replaced www.codeigniter.com with codeigniter.com --- system/helpers/download_helper.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index ece22d9a9..e8bc2f7f6 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -7,8 +7,8 @@ * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2006, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @license http://codeigniter.com/user_guide/license.html + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ @@ -22,7 +22,7 @@ * @subpackage Helpers * @category Helpers * @author ExpressionEngine Dev Team - * @link http://www.codeigniter.com/user_guide/helpers/download_helper.html + * @link http://codeigniter.com/user_guide/helpers/download_helper.html */ // ------------------------------------------------------------------------ -- cgit v1.2.3-24-g4f1b From 269b942a2bf7b022795e591d9b0ad04526ee7e09 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Mon, 28 Jan 2008 21:00:20 +0000 Subject: added ability to "extend" helpers * modified Loader to check for prefixed helpers in application/helpers folder * surrounded provided helper functions with if (! function_exists('foo')) conditionals so the user's helper functions take precedent. --- system/helpers/download_helper.php | 94 +++++++++++++++++++------------------- 1 file changed, 48 insertions(+), 46 deletions(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index e8bc2f7f6..2d0e737c9 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -37,60 +37,62 @@ * @param mixed the data to be downloaded * @return void */ -function force_download($filename = '', $data = '') +if (! function_exists('force_download')) { - if ($filename == '' OR $data == '') + function force_download($filename = '', $data = '') { - return FALSE; - } + if ($filename == '' OR $data == '') + { + return FALSE; + } - // Try to determine if the filename includes a file extension. - // We need it in order to set the MIME type - if (FALSE === strpos($filename, '.')) - { - return FALSE; - } + // Try to determine if the filename includes a file extension. + // We need it in order to set the MIME type + if (FALSE === strpos($filename, '.')) + { + return FALSE; + } - // Grab the file extension - $x = explode('.', $filename); - $extension = end($x); + // Grab the file extension + $x = explode('.', $filename); + $extension = end($x); - // Load the mime types - @include(APPPATH.'config/mimes'.EXT); + // Load the mime types + @include(APPPATH.'config/mimes'.EXT); - // Set a default mime if we can't find it - if ( ! isset($mimes[$extension])) - { - $mime = 'application/octet-stream'; - } - else - { - $mime = (is_array($mimes[$extension])) ? $mimes[$extension][0] : $mimes[$extension]; - } + // Set a default mime if we can't find it + if ( ! isset($mimes[$extension])) + { + $mime = 'application/octet-stream'; + } + else + { + $mime = (is_array($mimes[$extension])) ? $mimes[$extension][0] : $mimes[$extension]; + } - // Generate the server headers - if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) - { - header('Content-Type: "'.$mime.'"'); - header('Content-Disposition: attachment; filename="'.$filename.'"'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header("Content-Transfer-Encoding: binary"); - header('Pragma: public'); - header("Content-Length: ".strlen($data)); - } - else - { - header('Content-Type: "'.$mime.'"'); - header('Content-Disposition: attachment; filename="'.$filename.'"'); - header("Content-Transfer-Encoding: binary"); - header('Expires: 0'); - header('Pragma: no-cache'); - header("Content-Length: ".strlen($data)); - } + // Generate the server headers + if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) + { + header('Content-Type: "'.$mime.'"'); + header('Content-Disposition: attachment; filename="'.$filename.'"'); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header("Content-Transfer-Encoding: binary"); + header('Pragma: public'); + header("Content-Length: ".strlen($data)); + } + else + { + header('Content-Type: "'.$mime.'"'); + header('Content-Disposition: attachment; filename="'.$filename.'"'); + header("Content-Transfer-Encoding: binary"); + header('Expires: 0'); + header('Pragma: no-cache'); + header("Content-Length: ".strlen($data)); + } - echo $data; + echo $data; + } } - ?> \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 3a555ef16dfe811815af83fdeccfebd6c04b99b2 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 17 Apr 2008 22:03:00 +0000 Subject: The Download helper now exits within force-download(). --- system/helpers/download_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index 2d0e737c9..5e47fc5c9 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -91,7 +91,7 @@ if (! function_exists('force_download')) header("Content-Length: ".strlen($data)); } - echo $data; + exit($data); } } -- cgit v1.2.3-24-g4f1b From a9911fc06160f9d4538475e2bf9ee45c9ff8f746 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 1 May 2008 01:48:51 +0000 Subject: another change to the download helper for compatibility --- system/helpers/download_helper.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index 5e47fc5c9..ee3d78f25 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -91,7 +91,8 @@ if (! function_exists('force_download')) header("Content-Length: ".strlen($data)); } - exit($data); + echo $data; + exit; // exit($data); // didn't work on some browsers } } -- cgit v1.2.3-24-g4f1b From c0c5c97ffbfac81837e1913c77da7462c096ae87 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 1 May 2008 01:56:51 +0000 Subject: revert... Derek's an idiot --- system/helpers/download_helper.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index ee3d78f25..5e47fc5c9 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -91,8 +91,7 @@ if (! function_exists('force_download')) header("Content-Length: ".strlen($data)); } - echo $data; - exit; // exit($data); // didn't work on some browsers + exit($data); } } -- cgit v1.2.3-24-g4f1b From 7327499064ae165468c7440f8571c3e570b58a0b Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 5 May 2008 16:39:18 +0000 Subject: Added get_dir_file_info(), get_file_info(), and get_mime_by_extension() to the File Helper. Changed ( ! condition) into (! condition) within the code --- system/helpers/download_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index 5e47fc5c9..284c6c96e 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -61,7 +61,7 @@ if (! function_exists('force_download')) @include(APPPATH.'config/mimes'.EXT); // Set a default mime if we can't find it - if ( ! isset($mimes[$extension])) + if (! isset($mimes[$extension])) { $mime = 'application/octet-stream'; } -- cgit v1.2.3-24-g4f1b From 5583e1aae64ff7e902136c4ba610d438dc2015d4 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Sun, 11 May 2008 15:48:20 +0000 Subject: removed closing PHP tag from all framework files --- system/helpers/download_helper.php | 1 - 1 file changed, 1 deletion(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index 284c6c96e..39c2a2afc 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -95,4 +95,3 @@ if (! function_exists('force_download')) } } -?> \ No newline at end of file -- cgit v1.2.3-24-g4f1b From c7deac9f2f9e43cedb18202542e8a46061df046e Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Sun, 11 May 2008 16:27:41 +0000 Subject: Undoing change committed in r1115 --- system/helpers/download_helper.php | 1 + 1 file changed, 1 insertion(+) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index 39c2a2afc..284c6c96e 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -95,3 +95,4 @@ if (! function_exists('force_download')) } } +?> \ No newline at end of file -- cgit v1.2.3-24-g4f1b From a3ffbbb75ab9403941e4f810703313432b3993cc Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Sun, 11 May 2008 18:18:29 +0000 Subject: Removed closing PHP tags, replaced with a comment block identifying the end of the file --- system/helpers/download_helper.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index 284c6c96e..2096fd849 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -95,4 +95,6 @@ if (! function_exists('force_download')) } } -?> \ No newline at end of file + +/* End of file download_helper.php */ +/* Location: ./system/helpers/download_helper.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 0b59f270a432f8c7b6128981f0a39b4a2e2fbd34 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 13 May 2008 04:22:33 +0000 Subject: Some sweeping syntax changes for consistency: (! foo) changed to ( ! foo) || changed to OR changed newline standardization code in various places from preg_replace to str_replace --- system/helpers/download_helper.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index 2096fd849..53191c7a9 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -1,4 +1,4 @@ - Date: Fri, 12 Sep 2008 23:33:20 +0000 Subject: updated copyright --- system/helpers/download_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index 53191c7a9..2a555ae02 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2006, EllisLab, Inc. + * @copyright Copyright (c) 2008, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 -- cgit v1.2.3-24-g4f1b From 2067d1a727e7eb5e5ffb40e967f3d1fc4c8a41b2 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 13 Nov 2008 22:59:24 +0000 Subject: Changing EOL style to LF --- system/helpers/download_helper.php | 198 ++++++++++++++++++------------------- 1 file changed, 99 insertions(+), 99 deletions(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index 2a555ae02..ce2dd487d 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -1,100 +1,100 @@ - Date: Wed, 22 Apr 2009 14:15:09 +0000 Subject: updated copyrights to 2009 --- system/helpers/download_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index ce2dd487d..a8f7b1a7f 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2009, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 -- cgit v1.2.3-24-g4f1b From 7f3719faf120dc15f3d7b45e132ab3192f60ad62 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 5 Jan 2010 13:35:37 +0000 Subject: updated copyrights --- system/helpers/download_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index a8f7b1a7f..638ebaa88 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -6,7 +6,7 @@ * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2009, EllisLab, Inc. + * @copyright Copyright (c) 2008 - 2010, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 -- cgit v1.2.3-24-g4f1b From 76b369e191f4432ceba51ba7d7993c4ea54579ae Mon Sep 17 00:00:00 2001 From: Robin Sowell Date: Fri, 19 Mar 2010 11:15:28 -0400 Subject: Changed a few strstr to strpos for consistency w performance guidelines and to mirror EE2. --- system/helpers/download_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index 638ebaa88..eac024fcb 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -71,7 +71,7 @@ if ( ! function_exists('force_download')) } // 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.'"'); -- cgit v1.2.3-24-g4f1b From dd6719738936be31cdaa1758ca86d5eb14dcab3d Mon Sep 17 00:00:00 2001 From: Barry Mieny Date: Mon, 4 Oct 2010 16:33:58 +0200 Subject: Cleanup of stray spaces and tabs --- system/helpers/download_helper.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index eac024fcb..4a17e519e 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -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,7 +69,7 @@ if ( ! function_exists('force_download')) { $mime = (is_array($mimes[$extension])) ? $mimes[$extension][0] : $mimes[$extension]; } - + // Generate the server headers if (strpos($_SERVER['HTTP_USER_AGENT'], "MSIE") !== FALSE) { @@ -90,7 +90,7 @@ if ( ! function_exists('force_download')) header('Pragma: no-cache'); header("Content-Length: ".strlen($data)); } - + exit($data); } } -- cgit v1.2.3-24-g4f1b From 741de1c1319dd13de75348863cca591713dd46ce Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Wed, 10 Nov 2010 14:52:57 -0600 Subject: Updating PHP requirements in files 5.1.6 --- system/helpers/download_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index 4a17e519e..ba9c0a3ca 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -2,7 +2,7 @@ /** * 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 -- cgit v1.2.3-24-g4f1b From 0711dc87d98ce20d3a87f7ac43d78af8fba1dca7 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Wed, 5 Jan 2011 10:49:40 -0600 Subject: Hey look, it's 2011 --- system/helpers/download_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index ba9c0a3ca..6cecd0d11 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -6,7 +6,7 @@ * * @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 -- cgit v1.2.3-24-g4f1b From 0ea04149bbae0fdcde92b7362e7cbd76f0df3865 Mon Sep 17 00:00:00 2001 From: bubbafoley Date: Thu, 17 Mar 2011 14:55:41 -0500 Subject: load config files from environment specific locations in core classes, helpers and libraries --- system/helpers/download_helper.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index 6cecd0d11..a851e3c42 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -58,7 +58,14 @@ if ( ! function_exists('force_download')) $extension = end($x); // Load the mime types - @include(APPPATH.'config/mimes'.EXT); + if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT)) + { + @include(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT); + } + else + { + @include(APPPATH.'config/mimes'.EXT); + } // Set a default mime if we can't find it if ( ! isset($mimes[$extension])) -- cgit v1.2.3-24-g4f1b From 928083406322821a35a7d8a4205620c3854772a6 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Fri, 18 Mar 2011 09:02:37 -0400 Subject: Fixed coding to match standards from previous releases --- system/helpers/download_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index a851e3c42..56e4c2a2f 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -60,7 +60,7 @@ if ( ! function_exists('force_download')) // Load the mime types if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT)) { - @include(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT); + include(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT); } else { -- cgit v1.2.3-24-g4f1b From fdd5b11b62f127901ddff2e5dc7923b063371070 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Mon, 21 Mar 2011 21:28:58 -0400 Subject: Fixed logic and removed the error supressing --- system/helpers/download_helper.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index 56e4c2a2f..e537cdeca 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -58,13 +58,13 @@ if ( ! function_exists('force_download')) $extension = end($x); // Load the mime types - if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT)) + if (is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT)) { include(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT); } - else + elseif (is_file(APPPATH.'config/mimes'.EXT)) { - @include(APPPATH.'config/mimes'.EXT); + include(APPPATH.'config/mimes'.EXT); } // Set a default mime if we can't find it -- cgit v1.2.3-24-g4f1b From 05fa61144667c85b0463f7e8baa6af00aa195dc6 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 6 Apr 2011 22:57:43 +0100 Subject: Made Environment Support optional. Comment out or delete the constant to stop environment checks. --- system/helpers/download_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index e537cdeca..f8073d238 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -58,7 +58,7 @@ if ( ! function_exists('force_download')) $extension = end($x); // Load the mime types - if (is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT)) + if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT)) { include(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT); } -- cgit v1.2.3-24-g4f1b From 3a746655e92ec59ee7e731c3535673a9aedc5d3e Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Tue, 19 Apr 2011 10:59:47 -0500 Subject: Removing internal references to the EXT constant. Additionally, marked the constant as deprecated. Use ".php" instead. Also adding upgrade notes from 2.0.2 to 2.0.3. --- system/helpers/download_helper.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index f8073d238..1145688ae 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -58,13 +58,13 @@ if ( ! function_exists('force_download')) $extension = end($x); // Load the mime types - if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT)) + if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes.php')) { - include(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT); + include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'); } - elseif (is_file(APPPATH.'config/mimes'.EXT)) + elseif (is_file(APPPATH.'config/mimes.php')) { - include(APPPATH.'config/mimes'.EXT); + include(APPPATH.'config/mimes.php'); } // Set a default mime if we can't find it -- cgit v1.2.3-24-g4f1b From 114ab0988e20ac6be39ad363ff897a1a3b85e565 Mon Sep 17 00:00:00 2001 From: Razican Date: Mon, 25 Apr 2011 17:26:45 +0200 Subject: Fixed double-space typo. --- system/helpers/download_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index 1145688ae..e6752db4a 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -1,4 +1,4 @@ - Date: Fri, 1 Jul 2011 17:40:48 -0500 Subject: backed out 648b42a75739, which was a NON-trivial whitespace commit. It broke the Typography class's string replacements, for instance --- system/helpers/download_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/download_helper.php') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index e6752db4a..1145688ae 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -1,4 +1,4 @@ -