mirror of
https://github.com/parsecsv/parsecsv-for-php.git
synced 2026-02-19 08:36:39 +00:00
Fixed stupid code which caused auto function to not work in some situations.
git-svn-id: http://parsecsv-for-php.googlecode.com/svn/trunk@12 339761fc-0c37-0410-822d-8b8cac1f6a97
This commit is contained in:
@@ -1,3 +1,13 @@
|
||||
parseCSV 0.2.1
|
||||
-----------------------------------
|
||||
Date: 8-Aug-2007
|
||||
|
||||
- Fixed stupid code which caused auto function
|
||||
to not work in some situations.
|
||||
|
||||
-----------------------------------
|
||||
|
||||
|
||||
parseCSV 0.2.0 beta
|
||||
-----------------------------------
|
||||
Date: 2-Jan-2007
|
||||
|
||||
@@ -4,7 +4,7 @@ class parseCSV {
|
||||
|
||||
/*
|
||||
|
||||
Class: parseCSV v0.2.0 beta
|
||||
Class: parseCSV v0.2.1
|
||||
http://code.google.com/p/parsecsv-for-php/
|
||||
|
||||
Created by Jim Myhrberg (jim@zydev.info).
|
||||
@@ -230,10 +230,12 @@ class parseCSV {
|
||||
|
||||
if ( $prefered === null ) $prefered = $this->auto_prefered;
|
||||
|
||||
if ( empty($data) ) {
|
||||
if ( $this->check_data() ) {
|
||||
if ( empty($this->file_data) ) {
|
||||
if ( $this->check_data($file) ) {
|
||||
$data = &$this->file_data;
|
||||
} else return false;
|
||||
} else {
|
||||
$data = &$this->file_data;
|
||||
}
|
||||
|
||||
$chars = array();
|
||||
@@ -324,7 +326,7 @@ class parseCSV {
|
||||
$data = ltrim($strip[1]);
|
||||
}
|
||||
if ( $this->convert_encoding ) $data = iconv($this->input_encoding, $this->output_encoding, $data);
|
||||
if ( $data[strlen($data)-1] != "\n" ) $data .= "\n";
|
||||
if ( substr($data, -1) != "\n" ) $data .= "\n";
|
||||
$this->file_data = &$data;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user