diff options
-rw-r--r-- | system/helpers/download_helper.php | 2 | ||||
-rw-r--r-- | system/libraries/Image_lib.php | 11 | ||||
-rw-r--r-- | user_guide_src/source/changelog.rst | 6 |
3 files changed, 17 insertions, 2 deletions
diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index 000e4c707..901e3277c 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -151,7 +151,7 @@ if ( ! function_exists('force_download')) // so we have to make it conditional ... $charset = strtoupper(config_item('charset')); $utf8_filename = ($charset !== 'UTF-8') - ? $utf8_filename = get_instance()->utf8->convert_to_utf8($filename, $charset) + ? get_instance()->utf8->convert_to_utf8($filename, $charset) : $filename; isset($utf8_filename[0]) && $utf8_filename = " filename*=UTF-8''".rawurlencode($utf8_filename); diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php index 63e071e7c..dbe5cbbd1 100644 --- a/system/libraries/Image_lib.php +++ b/system/libraries/Image_lib.php @@ -1548,7 +1548,16 @@ class CI_Image_lib { */ public function image_display_gd($resource) { - header('Content-Disposition: filename='.$this->source_image.';'); + // RFC 6266 allows for multibyte filenames, but only in UTF-8, + // so we have to make it conditional ... + $filename = basename(empty($this->new_image) ? $this->source_image : $this->new_image); + $charset = strtoupper(config_item('charset')); + $utf8_filename = ($charset !== 'UTF-8') + ? get_instance()->utf8->convert_to_utf8($filename, $charset) + : $filename; + isset($utf8_filename[0]) && $utf8_filename = " filename*=UTF-8''".rawurlencode($utf8_filename); + + header('Content-Disposition: filename="'.$filename.'";'.$utf8_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'); diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 92403bc25..fb71481f5 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -64,6 +64,12 @@ Release Date: Not Released - Changed the default value of the **validate** option to ``TRUE``. - Changed the ``send()`` method to always return ``TRUE`` when sending multiple batches of emails. + + - :doc:`Image Manipulation Library <libraries/image_lib>` changes include: + + - Added option to change the output filename via the ``new_name`` option when rendering images with ``dynamic_output``. + - Updated to serve multibyte filenames when rendering images with ``dynamic_output``, if possible. + - :doc:`Database <database/index>` changes include: - Removed previously deprecated 'sqlite' driver (used for SQLite version 2; no longer shipped with PHP 5.4+). |