Skip to content

Commit 652a95c

Browse files
authored
Merge pull request #182 from contactashish13/helpscout-134468
Added support for non Latin characters
2 parents 4271131 + bdc4b25 commit 652a95c

File tree

9 files changed

+19
-12
lines changed

9 files changed

+19
-12
lines changed

classes/Visualizer/Module/Chart.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,6 @@ public function renderFlattrScript() {
379379
* @access public
380380
*/
381381
public function uploadData() {
382-
error_log( 'in uploadData ' . print_r( $_GET,true ) . print_r( $_POST,true ) );
383382
// validate nonce
384383
// do not use filter_input as it does not work for phpunit test cases, use filter_var instead
385384
if ( ! isset( $_GET['nonce'] ) || ! wp_verify_nonce( $_GET['nonce'] ) ) {

classes/Visualizer/Plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
class Visualizer_Plugin {
2929

3030
const NAME = 'visualizer';
31-
const VERSION = '2.1.3';
31+
const VERSION = '2.1.4';
3232

3333
// custom post types
3434
const CPT_VISUALIZER = 'visualizer';

classes/Visualizer/Render/Page/Data.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class="visualizer-select">
157157
</li>
158158
</ul>
159159
</li>
160-
<li class="group <?php echo apply_filters( 'visualizer_pro_upsell_class' ); ?> ">
160+
<li class="group <?php echo apply_filters( 'visualizer_pro_upsell_class', '' ); ?> ">
161161
<h2 class="group-title sub-group"
162162
data-current="chart"><?php _e( 'Import from other chart', 'visualizer' ); ?><span
163163
class="dashicons dashicons-lock"></span></h2>

classes/Visualizer/Source/Csv.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public function __construct( $filename = null ) {
6262
private function _fetchSeries( &$handle ) {
6363
// read column titles
6464
$labels = fgetcsv( $handle, 0, VISUALIZER_CSV_DELIMITER, VISUALIZER_CSV_ENCLOSURE );
65+
$labels = array_map( 'utf8_encode', $labels );
6566
// read series types
6667
$types = fgetcsv( $handle, 0, VISUALIZER_CSV_DELIMITER, VISUALIZER_CSV_ENCLOSURE );
6768

@@ -78,6 +79,7 @@ private function _fetchSeries( &$handle ) {
7879

7980
// re read the labels and empty types array
8081
$labels = fgetcsv( $handle, 0, VISUALIZER_CSV_DELIMITER, VISUALIZER_CSV_ENCLOSURE );
82+
$labels = array_map( 'utf8_encode', $labels );
8183
$types = array();
8284
}
8385

@@ -105,7 +107,10 @@ protected function _get_file_handle( $filename = false ) {
105107
// set line endings auto detect mode
106108
ini_set( 'auto_detect_line_endings', true );
107109
// open file and return handle
108-
return fopen( $filename ? $filename : $this->_filename, 'rb' );
110+
$fc = iconv( 'ISO-8859-1', 'utf-8', file_get_contents( $filename ? $filename : $this->_filename ) );
111+
$tmp = tempnam( sys_get_temp_dir(), rand() );
112+
file_put_contents( $tmp, $fc );
113+
return fopen( $tmp, 'rb' );
109114
}
110115

111116
/**

css/media.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Version: 2.1.3
2+
Version: 2.1.4
33
*/
44
#visualizer-library-view {
55
padding: 30px 10px 10px 30px;

index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Plugin Name: Visualizer: Charts and Graphs Lite
55
Plugin URI: https://themeisle.com/plugins/visualizer-charts-and-graphs-lite/
66
Description: A simple, easy to use and quite powerful tool to create, manage and embed interactive charts into your WordPress posts and pages. The plugin uses Google Visualization API to render charts, which supports cross-browser compatibility (adopting VML for older IE versions) and cross-platform portability to iOS and new Android releases.
7-
Version: 2.1.3
7+
Version: 2.1.4
88
Author: Themeisle
99
Author URI: http://themeisle.com
1010
License: GPL v2.0 or later

languages/visualizer.pot

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# This file is distributed under the GPL v2.0 or later.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: Visualizer: Charts and Graphs Lite 2.1.2\n"
5+
"Project-Id-Version: Visualizer: Charts and Graphs Lite 2.1.3\n"
66
"Report-Msgid-Bugs-To: https://github.com/Codeinwp/visualizer/issues\n"
7-
"POT-Creation-Date: 2017-05-31 11:52:41+00:00\n"
7+
"POT-Creation-Date: 2017-06-01 12:45:19+00:00\n"
88
"MIME-Version: 1.0\n"
99
"Content-Type: text/plain; charset=utf-8\n"
1010
"Content-Transfer-Encoding: 8bit\n"
@@ -102,7 +102,7 @@ msgid "Pro Addon"
102102
msgstr ""
103103

104104
#: classes/Visualizer/Module/Chart.php:298
105-
#: classes/Visualizer/Module/Chart.php:580
105+
#: classes/Visualizer/Module/Chart.php:579
106106
msgid "You have entered invalid URL. Please, insert proper URL."
107107
msgstr ""
108108

@@ -118,11 +118,11 @@ msgstr ""
118118
msgid "Insert Chart"
119119
msgstr ""
120120

121-
#: classes/Visualizer/Module/Chart.php:412
121+
#: classes/Visualizer/Module/Chart.php:411
122122
msgid "CSV file with chart data was not uploaded. Please, try again."
123123
msgstr ""
124124

125-
#: classes/Visualizer/Module/Chart.php:424
125+
#: classes/Visualizer/Module/Chart.php:423
126126
msgid "CSV file is broken or invalid. Please, try again."
127127
msgstr ""
128128

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "visualizer",
3-
"version": "2.1.3",
3+
"version": "2.1.4",
44
"description": "Visualizer Lite",
55
"repository": {
66
"type": "git",

readme.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ http://docs.themeisle.com/article/610-how-can-i-edit-the-data-manually
119119

120120
== Changelog ==
121121

122+
= 2.1.4 =
123+
* Fixed issues with non-latin chars on CSV files to import.
124+
122125
= 2.1.2 =
123126
* Fixed priority issue with wp_enqueue_media
124127
* Added latest version of sdk

0 commit comments

Comments
 (0)