verify_nonce should check if variable isset(). Closes #4704

This commit is contained in:
Mike Jolley 2014-02-11 13:38:53 +00:00 committed by Coen Jacobs
parent 8362bfe1b7
commit 5a79e2a809
1 changed files with 3 additions and 0 deletions

View File

@ -696,6 +696,9 @@ final class WooCommerce {
*/ */
public function verify_nonce( $action, $method = '_POST', $error_message = false ) { public function verify_nonce( $action, $method = '_POST', $error_message = false ) {
_deprecated_function( 'Woocommerce->verify_nonce', '2.1', 'wp_verify_nonce' ); _deprecated_function( 'Woocommerce->verify_nonce', '2.1', 'wp_verify_nonce' );
if ( ! isset( $method[ '_wpnonce' ] ) ) {
return false;
}
return wp_verify_nonce( $method[ '_wpnonce' ], 'woocommerce-' . $action ); return wp_verify_nonce( $method[ '_wpnonce' ], 'woocommerce-' . $action );
} }