Automattic\WooCommerce\Internal\ProductAttributesLookup
DataRegenerator::verify_tool_execution_nonce
Verify the validity of the nonce received when executing a tool from the Status - Tools page.
Method of the class: DataRegenerator{}
No Hooks.
Returns
null. Nothing (null).
Usage
// private - for code of main (parent) class only $result = $this->verify_tool_execution_nonce();
DataRegenerator::verify_tool_execution_nonce() DataRegenerator::verify tool execution nonce code WC 10.3.5
private function verify_tool_execution_nonce() {
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput
if ( ! isset( $_REQUEST['_wpnonce'] ) || wp_verify_nonce( $_REQUEST['_wpnonce'], 'debug_action' ) === false ) {
throw new \Exception( 'Invalid nonce' );
}
}