Skip to content

Commit 6a59c47

Browse files
author
Eugene Manuilov
committed
Fixed issue #4 with empty series, which appears due to leading space in a source file
1 parent e92becf commit 6a59c47

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

classes/Visualizer/Source/Csv.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ public function __construct( $filename = null ) {
6363
private function _fetchSeries( &$handle ) {
6464
// read column titles
6565
$labels = fgetcsv( $handle, 0, VISUALIZER_CSV_DELIMITER, VISUALIZER_CSV_ENCLOSURE, VISUALIZER_CSV_ESCAPRE );
66-
6766
// read series types
6867
$types = fgetcsv( $handle, 0, VISUALIZER_CSV_DELIMITER, VISUALIZER_CSV_ENCLOSURE, VISUALIZER_CSV_ESCAPRE );
6968

@@ -72,6 +71,7 @@ private function _fetchSeries( &$handle ) {
7271
}
7372

7473
// if no types were setup, re read labels and empty types array
74+
$types = array_map( 'trim', $types );
7575
if ( !self::_validateTypes( $types ) ) {
7676
// re open the file
7777
fclose( $handle );

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Pay attention that to turn your shortcodes into graphs, your theme has to have `
6161
= 1.4.1 =
6262
* Fixed issue which prevents the plugin working on SSL backend
6363
* Fixed issue with CSV file uploading in IE and other browsers
64+
* Fixed issue with empty series, which appears due to leading space in a source file
6465
* Added ability to define custom delimiter, enclosure and escape variables for CSV parsing
6566

6667
= 1.4 =

0 commit comments

Comments
 (0)