From ff1029018a8e5ba7261cdfb71fb3d102c3efc22b Mon Sep 17 00:00:00 2001 From: ytetsuro Date: Thu, 8 Feb 2018 22:08:23 +0900 Subject: Fixed bug that character code did not change --- system/helpers/download_helper.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'system') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index b7a5336b6..a2e28a6e9 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -153,9 +153,7 @@ if ( ! function_exists('force_download')) $charset = strtoupper(config_item('charset')); if ($charset !== 'UTF-8') { - $utf8_filename = (UTF8_ENABLED === TRUE) - ? get_instance()->utf8->convert_to_utf8($filename, $charset) - : FALSE; + $utf8_filename = get_instance()->utf8->convert_to_utf8($filename, $charset); } else { -- cgit v1.2.3-24-g4f1b From c82f3236069fae1f21a0900b026d346752d089c9 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 12 Feb 2018 14:31:20 +0200 Subject: [ci skip] More polish on the download helper --- system/helpers/download_helper.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'system') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index a2e28a6e9..000e4c707 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -149,17 +149,10 @@ if ( ! function_exists('force_download')) // RFC 6266 allows for multibyte filenames, but only in UTF-8, // so we have to make it conditional ... - $utf8_filename = $filename; $charset = strtoupper(config_item('charset')); - if ($charset !== 'UTF-8') - { - $utf8_filename = get_instance()->utf8->convert_to_utf8($filename, $charset); - } - else - { - $utf8_filename = $filename; - } - + $utf8_filename = ($charset !== 'UTF-8') + ? $utf8_filename = get_instance()->utf8->convert_to_utf8($filename, $charset) + : $filename; isset($utf8_filename[0]) && $utf8_filename = " filename*=UTF-8''".rawurlencode($utf8_filename); // Generate the server headers -- cgit v1.2.3-24-g4f1b