Skip to content

Commit 6cd34ac

Browse files
Export data? #41
added ajax security
1 parent d4eed90 commit 6cd34ac

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

classes/Visualizer/Module/Chart.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,8 @@ public function cloneChart() {
606606
* @access public
607607
*/
608608
public function exportData() {
609+
check_ajax_referer(Visualizer_Plugin::ACTION_EXPORT_DATA . Visualizer_Plugin::VERSION, "security");
610+
609611
$chart_id = $success = false;
610612
$capable = current_user_can( 'edit_posts' );
611613
if ( $capable ) {

classes/Visualizer/Render/Page/Data.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ protected function _renderSidebarContent() {
114114
$export_link = add_query_arg( array(
115115
'action' => Visualizer_Plugin::ACTION_EXPORT_DATA,
116116
'chart' => $this->chart->ID,
117+
'security' => wp_create_nonce(Visualizer_Plugin::ACTION_EXPORT_DATA . Visualizer_Plugin::VERSION),
117118
), admin_url( 'admin-ajax.php' ) );
118119
?>
119120
<input type="button" class="button" id="export-data" value="<?php esc_attr_e( 'Export Data', Visualizer_Plugin::NAME );?>" data-url="<?php echo $export_link;?>">

0 commit comments

Comments
 (0)