From be40faba61442a7c92a0376c6d5c30fe99fda018 Mon Sep 17 00:00:00 2001 From: Hardik Thakkar Date: Tue, 23 Apr 2019 18:19:17 +0530 Subject: [PATCH] Fixes #23440 : # symbol in Product Category name breaks Reports CSV export --- assets/js/admin/reports.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/js/admin/reports.js b/assets/js/admin/reports.js index 6e38ae4cd64..3173462e470 100644 --- a/assets/js/admin/reports.js +++ b/assets/js/admin/reports.js @@ -138,7 +138,7 @@ jQuery(function( $ ) { var groupby = $( this ) .data( 'groupby' ); var index_type = $( this ).data( 'index_type' ); var export_format = $( this ).data( 'export' ); - var csv_data = 'data:text/csv;charset=utf-8,\uFEFF'; + var csv_data = ''; var s, series_data, d; if ( 'table' === export_format ) { @@ -243,8 +243,9 @@ jQuery(function( $ ) { } ); } + csv_data = 'data:text/csv;charset=utf-8,\uFEFF' + encodeURIComponent( csv_data ); // Set data as href and return - $( this ).attr( 'href', encodeURI( csv_data ) ); + $( this ).attr( 'href', csv_data ); return true; }); });