Skip to content

Commit

Permalink
Merge pull request #182 from contactashish13/helpscout-134468
Browse files Browse the repository at this point in the history
Added support for non Latin characters
  • Loading branch information
selul authored Jun 2, 2017
2 parents 4271131 + bdc4b25 commit 652a95c
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 12 deletions.
1 change: 0 additions & 1 deletion classes/Visualizer/Module/Chart.php
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,6 @@ public function renderFlattrScript() {
* @access public
*/
public function uploadData() {
error_log( 'in uploadData ' . print_r( $_GET,true ) . print_r( $_POST,true ) );
// validate nonce
// do not use filter_input as it does not work for phpunit test cases, use filter_var instead
if ( ! isset( $_GET['nonce'] ) || ! wp_verify_nonce( $_GET['nonce'] ) ) {
Expand Down
2 changes: 1 addition & 1 deletion classes/Visualizer/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
class Visualizer_Plugin {

const NAME = 'visualizer';
const VERSION = '2.1.3';
const VERSION = '2.1.4';

// custom post types
const CPT_VISUALIZER = 'visualizer';
Expand Down
2 changes: 1 addition & 1 deletion classes/Visualizer/Render/Page/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class="visualizer-select">
</li>
</ul>
</li>
<li class="group <?php echo apply_filters( 'visualizer_pro_upsell_class' ); ?> ">
<li class="group <?php echo apply_filters( 'visualizer_pro_upsell_class', '' ); ?> ">
<h2 class="group-title sub-group"
data-current="chart"><?php _e( 'Import from other chart', 'visualizer' ); ?><span
class="dashicons dashicons-lock"></span></h2>
Expand Down
7 changes: 6 additions & 1 deletion classes/Visualizer/Source/Csv.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public function __construct( $filename = null ) {
private function _fetchSeries( &$handle ) {
// read column titles
$labels = fgetcsv( $handle, 0, VISUALIZER_CSV_DELIMITER, VISUALIZER_CSV_ENCLOSURE );
$labels = array_map( 'utf8_encode', $labels );
// read series types
$types = fgetcsv( $handle, 0, VISUALIZER_CSV_DELIMITER, VISUALIZER_CSV_ENCLOSURE );

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

// re read the labels and empty types array
$labels = fgetcsv( $handle, 0, VISUALIZER_CSV_DELIMITER, VISUALIZER_CSV_ENCLOSURE );
$labels = array_map( 'utf8_encode', $labels );
$types = array();
}

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

/**
Expand Down
2 changes: 1 addition & 1 deletion css/media.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Version: 2.1.3
Version: 2.1.4
*/
#visualizer-library-view {
padding: 30px 10px 10px 30px;
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin Name: Visualizer: Charts and Graphs Lite
Plugin URI: https://themeisle.com/plugins/visualizer-charts-and-graphs-lite/
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.
Version: 2.1.3
Version: 2.1.4
Author: Themeisle
Author URI: http://themeisle.com
License: GPL v2.0 or later
Expand Down
10 changes: 5 additions & 5 deletions languages/visualizer.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# This file is distributed under the GPL v2.0 or later.
msgid ""
msgstr ""
"Project-Id-Version: Visualizer: Charts and Graphs Lite 2.1.2\n"
"Project-Id-Version: Visualizer: Charts and Graphs Lite 2.1.3\n"
"Report-Msgid-Bugs-To: https://github.com/Codeinwp/visualizer/issues\n"
"POT-Creation-Date: 2017-05-31 11:52:41+00:00\n"
"POT-Creation-Date: 2017-06-01 12:45:19+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down Expand Up @@ -102,7 +102,7 @@ msgid "Pro Addon"
msgstr ""

#: classes/Visualizer/Module/Chart.php:298
#: classes/Visualizer/Module/Chart.php:580
#: classes/Visualizer/Module/Chart.php:579
msgid "You have entered invalid URL. Please, insert proper URL."
msgstr ""

Expand All @@ -118,11 +118,11 @@ msgstr ""
msgid "Insert Chart"
msgstr ""

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

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

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "visualizer",
"version": "2.1.3",
"version": "2.1.4",
"description": "Visualizer Lite",
"repository": {
"type": "git",
Expand Down
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ http://docs.themeisle.com/article/610-how-can-i-edit-the-data-manually

== Changelog ==

= 2.1.4 =
* Fixed issues with non-latin chars on CSV files to import.

= 2.1.2 =
* Fixed priority issue with wp_enqueue_media
* Added latest version of sdk
Expand Down

0 comments on commit 652a95c

Please sign in to comment.