summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorMehdi Bounya <5004111+mehdibo@users.noreply.github.com>2018-01-31 23:44:16 +0100
committerGitHub <noreply@github.com>2018-01-31 23:44:16 +0100
commit10cc80e9f35aac497fe5b60b3e409a213a5a5291 (patch)
treee371d9fa5966d64deb01cc4b4408db968b5b646c /system
parent2ad0b3553121ea2e5951179ac0aaca8fc71b767b (diff)
Update Image_lib.php
I didn't understand #5394 that well, what I understood from your comment is that we should convert the charset to UTF-8. I tested with **マルチバイト** but it outputs nothing (empty string), but when I add a character **before** the string (e.g. xマルチバイト) it worked fine.
Diffstat (limited to 'system')
-rw-r--r--system/libraries/Image_lib.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php
index f7b66c72e..b5e86f8a7 100644
--- a/system/libraries/Image_lib.php
+++ b/system/libraries/Image_lib.php
@@ -1548,7 +1548,8 @@ class CI_Image_lib {
*/
public function image_display_gd($resource)
{
- header('Content-Disposition: filename='.( (empty($this->new_image)) ? $this->source_image : $this->new_image ).';');
+ $filename = basename(empty($this->new_image) ? $this->source_image : $this->new_image);
+ header('Content-Disposition: filename='.$filename.'; filename*=UTF-8\'\''.rawurlencode(iconv(config_item('charset'), 'UTF-8', $filename)));
header('Content-Type: '.$this->mime_type);
header('Content-Transfer-Encoding: binary');
header('Last-Modified: '.gmdate('D, d M Y H:i:s', time()).' GMT');