Verify that user can view reports before allowing export download.
This commit is contained in:
parent
fbd231acf4
commit
e6c445e1d4
|
@ -172,7 +172,8 @@ class WC_Admin_Report_Exporter {
|
|||
if (
|
||||
isset( $_GET['action'] ) &&
|
||||
! empty( $_GET['filename'] ) &&
|
||||
self::DOWNLOAD_EXPORT_ACTION === wp_unslash( $_GET['action'] ) // WPCS: input var ok, sanitization ok.
|
||||
self::DOWNLOAD_EXPORT_ACTION === wp_unslash( $_GET['action'] ) && // WPCS: input var ok, sanitization ok.
|
||||
current_user_can( 'view_woocommerce_reports' )
|
||||
) {
|
||||
$exporter = new WC_Admin_Report_CSV_Exporter();
|
||||
$exporter->set_filename( wp_unslash( $_GET['filename'] ) ); // WPCS: input var ok, sanitization ok.
|
||||
|
|
Loading…
Reference in New Issue