From b8cd5e657363795f127ae5e02e69972627b3fe9c Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 21 May 2015 01:10:36 +0300 Subject: Fix a bug in the CSV export DB utility Reported via the forums: http://forum.codeigniter.com/thread-61810.html --- system/database/DB_utility.php | 4 ++-- user_guide_src/source/changelog.rst | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php index 57356ac53..78398ea83 100644 --- a/system/database/DB_utility.php +++ b/system/database/DB_utility.php @@ -249,7 +249,7 @@ abstract class CI_DB_utility { $out .= $enclosure.str_replace($enclosure, $enclosure.$enclosure, $name).$enclosure.$delim; } - $out = substr(rtrim($out), 0, -strlen($delim)).$newline; + $out = substr($out, 0, -strlen($delim)).$newline; // Next blast through the result array and build out the rows while ($row = $query->unbuffered_row('array')) @@ -258,7 +258,7 @@ abstract class CI_DB_utility { { $out .= $enclosure.str_replace($enclosure, $enclosure.$enclosure, $item).$enclosure.$delim; } - $out = substr(rtrim($out), 0, -strlen($delim)).$newline; + $out = substr($out, 0, -strlen($delim)).$newline; } return $out; diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 15be738d6..5c2c4d944 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -29,6 +29,7 @@ Bug fixes for 3.0.1 - Fixed a bug (#3823) - :doc:`Session Library ` drivers Redis and Memcached didn't properly handle locks that are blocking the request for more than 30 seconds. - Fixed a bug (#3846) - :doc:`Image Manipulation Library ` method `image_mirror_gd()` didn't properly initialize its variables. - Fixed a bug (#3854) - `field_data()` didn't work properly with the Oracle (OCI8) database driver. +- Fixed a bug in the :doc:`Database Utility Class ` method ``csv_from_result()`` didn't work with a whitespace CSV delimiter. Version 3.0.0 ============= -- cgit v1.2.3-24-g4f1b