WC_Admin_Report::check_current_range_nonce( string $current_range )

Check nonce for current range.


Description Description


Parameters Parameters

$current_range

(Required) Current range.


Top ↑

Source Source

File: includes/admin/reports/class-wc-admin-report.php

	public function check_current_range_nonce( $current_range ) {
		if ( 'custom' !== $current_range ) {
			return;
		}

		if ( ! isset( $_GET['wc_reports_nonce'] ) || ! wp_verify_nonce( sanitize_key( $_GET['wc_reports_nonce'] ), 'custom_range' ) ) { // WPCS: input var ok, CSRF ok.
			wp_die(
				/* translators: %1$s: open link, %2$s: close link */
				sprintf( esc_html__( 'This report link has expired. %1$sClick here to view the filtered report%2$s.', 'woocommerce' ), '<a href="' . esc_url( wp_nonce_url( esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ), 'custom_range', 'wc_reports_nonce' ) ) . '">', '</a>' ), // @codingStandardsIgnoreLine.
				esc_attr__( 'Confirm navigation', 'woocommerce' )
			);
			exit;
		}
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.4 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.